4

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?

7

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 .DMG (Apple disk image file) from Azul Systems for their Zulu implementation of a Java JDK. Optionally, they provide support for a fee.

https://www.azul.com/downloads/zulu/

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.

flowchart of finding and choosing a vendor of Java for macOS

  • 1
    Say I'm a layperson who just wants to run a random .jar file he found on the internet. In the interest of security, I'd like to run the latest version of java. Following your flowchart, it looks like I need to learn about "Java modularization, jlink, and jpackage", which is already way out of my league. What do I need to download? – Wowfunhappy Dec 20 '18 at 22:11
  • 1
    @Wowfunhappy I do mention that Oracle no longer encourages end-users directly installing Java on their machine. But you can download a JDK which is a JRE plus some developer tools. Long story short: I recommend you download Zulu, specifically the .DMG ([Apple disk image file]) to mount on your Mac, inside of which you will find an installer to run. You will then have a JVM installed in /Library/Java/JavaVirtualMachines. Later, you can upgrade in the same manner, deleting the old JVM from that folder. I do this myself. – Basil Bourque Dec 20 '18 at 22:24
  • @Wowfunhappy I added a tl;dr section up top with this same personal recommendation. – Basil Bourque Dec 20 '18 at 22:43
2

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

(This would be a comment but I don't have the rep).

  • This seems like a valid Answer to me, not really a comment. Not a solution I would choose, but valid nevertheless. – Basil Bourque Mar 3 at 19:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .