Java Licensing: Is the Free Lunch over?

The license change to Java SE 8, as well as the new license for Java SE 9 and onwards lead to confusion within the Java community. Looking for information on the web, one finds results in the spectrum from “Is Java in Jepoardy?” to “Java is still free!”. The good news is: yes, Java is still free. The bad news: not necessarily Oracle’s Java distribution.

In this article, we discuss the situation revolving around Oracle’s license change and its consequences. For this, we need to understand how the Oracle JDK is connected to OpenJDK. Furthermore, we take a look at some alternatives to Oracle’s Java distribution and how divergence between the different distribution is avoided.

What you will need:

  • about 15-20 minutes of time

Oracle’s Java Distribution and OpenJDK

Oracle started the OpenJDK project and will continue to support it, more on that later. OpenJDK was and will stay the reference implementation for Java.

But how does committing to the OpenJDK work? Oracle lead the development of OpenJDK from Java 6 onwards. When Oracle stopped supporting Java SE 6 (and thus OpenJDK 6), Red Hat’s Andrew Haley assumed global leadership for OpenJDK 6. The same procedure happened with Java SE 7, again with Haley assuming leadership for OpenJDK 7. This did and does not mean that only Red Hat can contribute to those OpenJDK versions. It just means that Red Hat manages the project. When Red Hat dropped the leadership for OpenJDK 6, Azul Systems took over and continues supporting OpenJDK 6 to this very day.

So you might ask “What is the difference between OpenJDK and Oracle JDK? Was there ever a reason for using the Oracle JDK?” Yes, there were and are reasons to use the Oracle JDK. The Oracle JDK ships with tools like Mission Control, Java Flight Recorder and VisualVM, which are closed source. This, in part, is the reason why Oracle published its Java distribution under its Binary Code License Agreement for Java SE and not under some open source license like GPL. In contrast, OpenJDK was and will continue to be released under GPLv2 with Classpath Extension (short: GPLv2CE). With respect to behaviour, the Oracle JDK and OpenJDK are designed as drop-in replacement for each other. More on this in the section Bringing Order to the Chaos

Your next question might be “What did actually change?”. The release cycles and the support through Oracle for the Java versions, both for the Oracle JDK and for OpenJDK. For Oracle’s Java SE distribution the support plan is as follows:

  • If you want to use Java in production, you need to have an active Oracle Java SE Subscription.

  • Oracle will produce a new release every six month.

  • Patches for a release will be done in a quarterly manner.

  • Every successive release is a superset of all preceding releases. Thus, older releases are superfluous and not longer supported. This means that a release reaches its end of life typically six months after it was released.

  • The only exception to this rule are the Long Term Support (short: LTS) releases: Updates are available for six months publicly. If you have an Oracle Java SE Subscripton, support is available for five years.

  • Every sixth release is a LTS release.

Since Java 9, OpenJDK is maintained and built by Oracle, still under GPLv2CE, as long as the corresponding Java SE version has not yet reached its end of life. After a release has reached its end of life, Oracle stops producing updates for this OpenJDK release (this includes security patches). Oracle will hand over the OpenJDK code line of LTS releases to a qualified project lead, so it can be developed further under GPLv2CE. This is what we meant by saying “Oracle […] will continue to support OpenJDK”. Andrew Haley from Red Hat is a possible candidate for the OpenJDK 8 lead.

The culprit, however, is that Oracle only hands over the code line of the LTS releases. Thus, the OpenJDK project has to wait 30 months before receiving a new code line from Oracle. In the mean time, the OpenJDK community is responsible for “keeping up” with the development of the Java specification.

The Zoo of OpenJDK Distributions

This is where different communities and vendors step in to close the gap, providing extended and timely updates, premium support subscriptions, the integration of features from newer releases and/or the promise to downstream their updates back to the OpenJDK project. We will take a closer look at some of them, in alphabetical order.

AdoptOpenJDK

  • Provided by: AdoptOpenJDK

  • Published under: GPLv2CE

  • Premium Support available: No

As the homepage says:

AdoptOpenJDK provides prebuilt OpenJDK binaries from a fully open source set of build scripts and infrastructure.

Thus, the project itself does not patch or update OpenJDK, but only generates binary builds. Builds for JDK 8 to 11 are available either with the HotSpotVM or Eclipse’s OpenJ9 (released under Eclipse Public License, Version 2 and/or Apache License 2.0). Supported operating systems include Linux, Windows, macOS and Solaris. Docker images based on Ubuntu 18.04 are available.

Corretto

  • Provided by: Amazon

  • Published under: GPLv2CE

  • Premium Support available: No

Amazon has a long history supporting Java. With the advent of AWS Lambda and its support for Java, it is natural that Amazon develops an JDK of their own. Corretto was announced in a post by Aron Gupta on November 14th, 2018. Gupta gives the promise to

[…] downstream fixes made in OpenJDK, add enhancements based on our own experience and needs, and then produce Corretto builds. In case any upstreaming efforts for such patches is not successful, delayed, or not appropriate for OpenJDK project, we will provide them to our customers for as long as they add value. If an issue is solved a different way in OpenJDK, we will move to that solution as soon as it is safe to do so.

The source code is publicly available on GitHub. As of January 31st, 2019, Corretto 8 is publicly available for AWS Linux 2, Windows and macOS, as well as Docker images based on Amazon Linux 2. General availability for Corretto 11 should follow in the near future.

Oracle Java SE

This entry needs little explanation. Oracle builds and maintains their own distribution of Java. Java SE is publicly available in versions 8 and 11 for Linux, Windows, macOS and Solaris, although use in production requires an active Oracle Java SE Subscription. With this subscription, you furthermore get access to updates for Java SE 6 and 7. The subscription costs USD 2.50 (license for one desktop) or USD 25.00 (license for one processor in a server / the cloud). Length of terms is usually one year. For Java 8, a Docker image based on Oracle Linux Server 7.6 is available.

As stated above, non-LTS releases are always superseded by newer releases, thus Oracle provides support for non-LTS releases only until the next release comes out. For LTS, releases, if you have an active Oracle Java SE subscription (which gives you Premier Support), you will receive updates for five years after release.

Red Hat OpenJDK

  • Provided by: Red Hat

  • Published under: GPLv2CE

  • Premium Support available: Yes

As stated previously, Red Hat is invested in supporting the OpenJDK projects, e.g. by taking the global leadership for OpenJDK7 and OpenJDK8. Applying for global leadership in OpenJDK11, it is clear that Red Hat plans to further support OpenJDK in the future. In addition, Red Hat developed a low pause time garbage collector, Shenandoah GC, which is included in all Red Hat OpenJDK distributions and in the official OpenJDK12 releases. For LTS releases, Red Hat promises a support of at least six years, with OpenJDK8 and OpenJDK11 having support until June 2023 and October 2024, respectively.

While a support subscription does not give you privileged access to Red Hat’s OpenJDK distributions, you get on-call support as well as access to the Ret Hat Customer Portal. Support is available as Professional and Enterprise Support with the main difference being the response time. For RHEL, support can be bought with one of the Linux subscriptions (subscription type must at least be “Standard”). Support for OpenJDK on Windows is accessible through a JBoss Middleware Subscription.

Red Hat OpenJDK in versions 7, 8 and 11 is available through yum. Versions 8 and 11 for Windows are available as Download.

SapMachine

  • Provided by: SAP

  • Published under: GPLv2CE

  • Premium Support available: No

SapMachine is a “friendly fork” of OpenJDK, maintained by SAP. SAP is committed to keep the differences between SapMachine and OpenJDK as minimal as possible:

Therefore features identified as required by SAP applications should be developed in and contributed to OpenJDK. Only if this is, for what ever reason, not possible, differences between SapMachine and OpenJDK are considered acceptable. However, they have to be kept as small as possible.

SapMachine versions 10 and 11 are available for Linux, Windows and macOS. Pre-releases for SapMachine 12 and 13 are also available, as well as Docker images based on Ubuntu 16.04. The source code is available on GitHub.

Zulu Enterprise

  • Provided by: Azul Systems

  • Published under: GPLv2CE

  • Premium Support available: Yes

Like Red Hat, Zulu has a long history supporting OpenJDK. They took over leadership of OpenJDK 6. Zulu is built from OpenJDK, with bug fixes added through Azul Systems. Azul Systems makes selected builds of Zulu public availability. With a standard support subscriptions, updates are provided in a quarterly manner. Premium support gives you access to hotfixes in a timely manner. Support can be bought on a by-year basis, ranging from from USD 13,500 (for 25 Systems, Standard Support) to USD 290,300 (fur an unlimited number of systems, Premium Support). For details, please visit the Zulu Enterprise Homepage.

Versions 7 to 11 of Zulu are available for Linux (also as tar archive or through apt and yum), Windows and macOS. Zulu 6 is available for Linux and Windows. Docker images are available for all versions from 6 to 11 and are based on Ubuntu 18.04. The source code is publicly available on GitHub.

Zulu offers support of non-LTS releases for at least 2.5 years (although some are supported for 3.5 years). LTS releases, however, are always supported for 9 years. In order to receive regular updates, you need to have an active subscription.

Bringing Order to the Chaos

With so many different distributions in the wild, it is likely that they will diverge. This, however, would lock the user into a specific distribution. To prevent this from happening, OpenJDK releases the Java Compatibility Kit (short: JCK or TCK). If an JDK implementation passes the JCK tests, it can be replaced by every other implementation that passes the JCK tests and vice-versa. All presented distributions have passed the JCK tests.

Conclusion

Oracle’s changes to its licensing models brought confusion, but at the same time opportunities. There are more OpenJDK distributions than ever. Each has its own focus, most of them are committed to downstreaming patches and features back to OpenJDK.

To prevent derivation between the different distributions, OpenJDK releases the JCK, and all presented distributions passed TCK tests, guaranteeing compatibility between the different distributions.

Further Reading

This article provided information on a need-to-know basis. Some parts were intentionally explained in a shallow manner, some parts were not discussed at all. For a complete picuture, I encourage everyone to read “Java is still free!” (the longer version). Please encourage your colleagues to read this article.

If you have any questions or remarks, feel free to contact me via marco(dot)bungart(at)consol(dot)de or Twitter.

Author: Marco Bungart
Tags: java
Categories: development