Apple - Obtain Java 11 for macOS?
tl;dr
If you are an end-user needing a free-of-cost JVM to run a Java app on your Mac (rather than a developer), my personal recommendation is to download an .pkg
file from AdoptOpenJDK.
Open that file to run a macOS installer.
You will then find a JVM installed in /Library/Java/JavaVirtualMachines
. Later, you can upgrade in the same manner, deleting the old JVM from that folder.
Details
Yes, there have been several major changes to the evolution of Java in recent years, and they can be a bit confusing.
Multiple vendors, both free and paid
First, know that there are new options available for those wishing to pay for commercially supported implementations of Java. And know that Java is still available freely without cost. For both a summary as well as the gory details, read this white paper published by major figures in the Java community: Java Is Still Free
OpenJDK
Secondly, know that all releases for Java 11 and later for macOS are based on the same codebase, the open-source project known as OpenJDK.
Apple contributes Mac-specific code to this project, and has staff working on this to make sure that Java continues to work well on macOS.
IBM, Oracle, and many other companies have contributed code and testing as well. Oracle has recently announced their intention to reach feature-parity between their own Oracle-branded Java releases and the OpenJDK product; this even included the donation of some of their previously-commercial tools such as Flight Recorder to OpenJDK.
The upshot is that you should see very similar behavior and features across the various sources of Java for macOS.
JVM bundled within desktop apps
If you make desktop apps to run locally on a Mac or other computer, you may continue to do so, and keep on using Swing and/or JavaFX as always. But the delivery of your app will change.
Java Applet and Java Web Start technologies are being phased out. Oracle will no longer encourage end-users to have a JVM by itself installed. Instead, Oracle advises building your app as a standalone executable with a JVM bundled inside. This has already been commonly done on Macs, especially so if delivering an app through the Apple App Store. That approach is the new normal, to be done across all platforms including macOS, Windows, Linux, etc. The new Java Modularization technology that began with Java 9, including the jlink and jpackage tools, make it easier than ever to bundle a down-sized JVM with your app.
For more info, see the white paper Java Client Roadmap Update of 2018-03.
So, for the purpose of bundling with your app, you will need to consider redistribution/deployment rights when choosing a JVM vendor and product.
Choosing a vendor
Some major vendors of Java to consider for Java 11 and later:
- Azul Systems
Offering two product lines, Zulu based directly on OpenJDK with possibly a few tweaks, and Zing a specially-enhanced version of the Java platform. - Oracle
Offering their own commercial product Oracle JDK and the quite-similar free-of-cost and GPL-licensed jdk.java.net. - AdoptOpenJDK.net
Offering free-of-cost builds of Java based on OpenJDK. Choose between with the usual HotSpot engine (just-in-time compiler & optimizer) or the OpenJ9 engine from Eclipse (previously from IBM).
Here is a diagram chart that may help guide your decision-making. This chart is not necessarily complete or accurate. It is simply meant to help get you oriented. You should research further your options.
If you want to have the simplest life possible, install homebrew and then install java with brew cask install java
.