You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?
What you were trying to do (and why)
Install sbt and use my existing Java installation.
What happened (include command output)
sbt is running with JDK 13.0.2.
Command output
$ sbt 'eval sys.props("java.version")'
[warn] No sbt.version set in project/build.properties, base directory: /private/tmp/foo
[info] Loading settings for project global-plugins from idea.sbt,vimquit.sbt,plugins.sbt,pgp.sbt ...
[info] Loading global plugins from /Users/eed3si9n/.sbt/1.0/plugins
[info] Set current project to foo (in build file:/private/tmp/foo/)
[info] ans: String = 13.0.2
The reason this is problematic for sbt is because it is a build tool, used to to build libraries and applications on JVM. Changing the JVM version suddenly is a breaking change itself, but the even bigger issue is that the JVM version has a transitive property ("contagious"). Once a library is published with JDK 13, then the consumer has to use JDK 13 too.
For tooling and library authors, this usually means sticking to the lowest stable JDK version. Even for application authors, upgrading from one JDK version to another is a decision we don't make lightly. Certainly not by brew upgrade accidents.
Homebrew will use brewed dependencies where possible. The fact that other Java versions were previously possible was an unfortunate side-effect of java not being built from source as a formula. The current situation is the intended usage within Homebrew. If people want to use a different dependency the best course of action is to maintain it in a tap, which is very easy to do: https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap.
Just a couple of points to highlight:
The openjdk installed as a dependency is not symlinked anywhere and will be used only if JAVA_HOME is not set
If you'd like to use another Java installation feel free to set JAVA_HOME to any Java you want
Using some random/installed by default Java is not reliable for software shipping.
Ref b812e59#diff-bdf3fc0debecefebed7b56c142626381R11
ran
brew update
and can still reproduce the problem?ran
brew doctor
, fixed all issues and can still reproduce the problem?ran
brew gist-logs <formula>
(where<formula>
is the name of the formula that failed) and included the output link?https://gist.github.com/16a70480726f125b3f962d52838e97bf
if
brew gist-logs
didn't work: ranbrew config
andbrew doctor
and included their output with your issue?What you were trying to do (and why)
Install sbt and use my existing Java installation.
What happened (include command output)
sbt is running with JDK 13.0.2.
Command output
The reason this is problematic for sbt is because it is a build tool, used to to build libraries and applications on JVM. Changing the JVM version suddenly is a breaking change itself, but the even bigger issue is that the JVM version has a transitive property ("contagious"). Once a library is published with JDK 13, then the consumer has to use JDK 13 too.
For tooling and library authors, this usually means sticking to the lowest stable JDK version. Even for application authors, upgrading from one JDK version to another is a decision we don't make lightly. Certainly not by
brew upgrade
accidents.What you expected to happen
Use the JDK that's installed in the environment.
Step-by-step reproduction instructions (by running
brew install
commands)notes
#50536
The text was updated successfully, but these errors were encountered: