Home > AutoPkg, Java, Mac administration, macOS > Oracle Java JDK, OpenJDK, Java 11 and macOS

Oracle Java JDK, OpenJDK, Java 11 and macOS

With Java 8 approaching the end of its lifecycle, Oracle has made some changes to the Oracle JDK license that will affect Java 11’s JDK. As of Oracle Java JDK 8, you can use the JDK for free in the following circumstances:

  • Development
  • Testing
  • Prototyping
  • Production

As of Oracle Java JDK 11, you can use the JDK for free in the following circumstances:

  • Development
  • Testing
  • Prototyping

Notice that Production has dropped off the list? If you use Oracle Java JDK 11 for production use, Oracle is now expecting payment. For the complete details, please see the license agreement (relevant sections highlighted below):

Screen Shot 2018 10 19 at 10 32 44 AM

If you don’t want to or can’t pay Oracle, what are the available options?

1. Keep using Oracle Java JDK 8

Oracle will continue to provide updates for Java 8 until January 2019, so a short-term solution is to keep using JDK 8 until support ends. This is only a short term solution however. If you want to continue using Java 8 past January 2019, you may need to start paying Oracle in order to get access to continuing Java 8 support.

2. Migrate from Oracle Java JDK to OpenJDK

In addition to its commercial offering, Oracle has an open-source Java available named OpenJDK. As of Java 11, Oracle will be providing functionally identical JDK builds to both the commercially licensed Oracle JDK and the open-source OpenJDK. For more details, please see below the jump:

An important difference between Oracle JDK 11 and OpenJDK 11 for Mac admins is the following:

  • Oracle JDK: Oracle will provide an installer package for macOS
  • OpenJDK: Oracle does not provide an installer for macOS at this time.

OpenJDK builds for macOS are currently available as zip and tar.gz files. The JDK files need to be uncompressed and moved into the following location on macOS:

/Library/Java/JavaVirtualMachines

Screen Shot 2018 10 19 at 10 46 20 AM

Once uncompressed into /Library/Java/JavaVirtualMachines, the JDK build should be stored in a directory named for the specific OpenJDK version. The directory and all enclosed files need to have the following permissions set:

macOS should automatically pick up the new Java version once added to /Library/Java/JavaVirtualMachines.

Screen Shot 2018 10 19 at 10 55 50 AM

To display information about it, run the following command:

java -version

Screen Shot 2018 10 19 at 11 10 05 AM

To help address the current lack of an installer package for OpenJDK 11, I’ve written several AutoPkg recipes:

Screen Shot 2018 10 19 at 11 58 16 AM

The .pkg recipe will create an installer package which does the following:

  1. Removes any existing OpenJDK 11 builds from /Library/Java/JavaVirtualMachines using a preinstall script
  2. Installs the latest OpenJDK 11 build with the correct permissions into /Library/Java/JavaVirtualMachines

Screen Shot 2018-10-19 at 1.44.57 PM

The preinstall script used is available below:

  1. Bob Colquhoun
    October 19, 2018 at 7:03 pm

    Will the SAP GUI for Java work with OpenJDK 11 I wonder (nee hope)?

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: