Obtain Java 11 for macOS?

I know in recent years the Java development cadence has changed, becoming much more rapid and more predictably scheduled. New plans were announced for regular Long-Term Support (LTS) releases. And I have heard Oracle changed their licensing terms for their Oracle-branded releases.

All of this has left me confused as to how and where I can obtain Java 11 or later for my Mac. Can someone give some general overview of my options?


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.

screenshot of AdoptOpenJDK.net web site page

Open that file to run a macOS installer.

screenshot of "Install AdoptOpenJDK" installer app running

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.

screenshot of Finder showing JavaVirtualMachines 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.

Flowchart guiding you in choosing a vendor for a Java 11 implementation


Motivations in choosing a vendor for Java


If you want to have the simplest life possible, install homebrew and then install java with brew cask install java.