141 points · by nnnmnten · 7y ago · 86 comments
There is a great answer here... https://stackoverflow.com/questions/52524112/how-do-i-instal...
brew install java (12)
brew install java11
And you can simplify things...In your .bashrc:
export JDK_HOME=`/usr/libexec/java_home -v 12` # v9+ change to the version you installed
export JAVA_PATH=$JDK_HOME
export JAVA_HOME=$JDK_HOME
export PATH="."
export PATH="${PATH}:${JAVA_HOME}/bin"I've just been hearing a lot of fuss about GraalVM, though haven't had time to investigate what's so special about it nor how it might help typical 'enterprise' services and Java apps.
It was quite good in the past and one of the first to support JIT caching.
Never used it after it went open source though.
Most of the actual backport work is done by the OpenJDK participants, notably people from Red Hat (like me), SAP, Amazon, Azul and others. Oracle does not participate in OpenJDK 8u/11u directly, opting to maintain their separate tree, from which they build Oracle JDK 8u/11u available under the commercial license. There is also a security collaboration between many companies (OpenJDK Vulnerability Group), which drops its deliverables in relevant source trees.
At one point, I tried to draw this map to show the bird's eye view on the landscape: https://shipilev.net/jdk-updates/map/ -- you can find AdoptOpenJDK there.
What gets people confused is http://openjdk.java.net/ linking to Oracle distribution (either at jdk.java.net, or Oracle site). That might be seen as "OpenJDK providing the binaries", but it is actually not: it links to one of the distribution providers.
https://adoptopenjdk.net/upstream.html
Note that these are different binaries, build by RedHat not by AdoptOpenJDK. They are distributed there because the Java 8 and Java 11 OpenJDK projects are not allowed to post builds on https://jdk.java.net.
System packages shift around minor versions which is fine 99% of the time (given Java's compatibility especially). I've occasionally needed to work around a bug in a specific version.
Apple requires you to copy this to a very specific, deeply nested, hidden system directory.
That's definitely not something I could ask an end user to deal with.
After the bait and switch with the licensing for the original Java distribution, I'm not comfortable downloading anything from Oracle anyway. It's just too risky.
> After the bait and switch with the licensing for the original Java distribution
The product known as OracleJDK used to be part free, part commercial, based on which features you used. JRE downloads also used to contain that annoying search toolbar. What we at Oracle have done is completely open-source the JDK, for the first time in its history, and release it under two licenses: a free license, and a license for those who wish to buy support. There is a large clear warning on each download page guiding people to the distribution they need. I think most people agree that this is a very welcome change, and I see no bait and switch.
I am glad to hear the toolbar on the JRE is gone, and I'm glad there's a prominent notice on the download pages - but there's effectively no free official standalone JRE for commercial use anymore.
Why are you asking your end-users to manually install your development dependencies, though? It's called the J D K for a reason. Ship a linked version of your application.
> Apple requires you to copy this to a very specific, deeply nested, hidden system directory.
This just isn't true - you can run Java from anywhere. It's just a tarball containing the binaries. Un-tar and run the binaries like you would any other program. I never 'install' Java on macOS.
If you want to run a legacy desktop Java application (without bundled JRE - and yes, there's still plenty of these apps out there), MacOS will actually do the prompting for you.
And it takes you to the commercial JRE download page, which isn't something I'm willing to install. So the only reasonable option I could find as an end-user who wants a non license-encumbered JRE is to install OpenJDK.
> This just isn't true - you can run Java from anywhere. It's just a tarball containing the binaries. Un-tar and run the binaries like you would any other program. I never 'install' Java on macOS.
From the command line, of course that's true.
But if you double click on a .jar file from Finder, does MacOS find your JRE in a random directory? I was pretty sure that it doesn't do that.
(select JRE FX or JDK FX from the dropdown I guess - they've changed the download page recently)
Practically speaking, it shouldn't matter as they all pass the Java TCK.
2. Corretto and Zulu each have their own patch set. Corretto backports a couple of G1 fixes and Zulu backports Flight Recorder and TLS 1.3.
Why not compile your classes to WASM instead?
https://github.com/WebAssembly/gc/blob/master/proposals/gc/O...
If Java is to evolve as an open platform, it needs to break free from the TCK that disallowed Apache Harmony to exist.
We don't need it and an independent TCK could be developed.