253

Due to recent Oracle Java SE Support Roadmap policy update (end of $free release updates from Oracle after March 2019 in particular), I've been searching for alternatives to Oracle Java. I've found that OpenJDK is an open-source alternative. And I've found AdoptOpenJDK, now known as Adoptium, which is a prebuilt binary. It puzzles.

What is the difference between OpenJDK and Adoptium/AdoptOpenJDK?

kojiro
  • 67,745
  • 16
  • 115
  • 177
Mikhail Kholodkov
  • 17,248
  • 15
  • 52
  • 69
  • 2
    Update: *AdoptOpenJDK* has changed its name to *Adoptium*, as part of its [move to the Eclipse Foundation](https://blog.adoptopenjdk.net/2020/06/adoptopenjdk-to-join-the-eclipse-foundation/). – Basil Bourque Jun 24 '20 at 06:04

2 Answers2

369

In short:

  • OpenJDK has multiple meanings and can refer to:
    • free and open source implementation of the Java Platform, Standard Edition (Java SE)
    • open source repository — the Java source code aka OpenJDK project
    • prebuilt OpenJDK binaries maintained by Oracle
    • prebuilt OpenJDK binaries maintained by the OpenJDK community
  • AdoptOpenJDK — prebuilt OpenJDK binaries maintained by community (open source licensed)

Explanation:

Prebuilt OpenJDK (or distribution) — binaries, built from http://hg.openjdk.java.net/, provided as an archive or installer, offered for various platforms, with a possible support contract.

OpenJDK, the source repository (also called OpenJDK project) - is a Mercurial-based open source repository, hosted at http://hg.openjdk.java.net. The Java source code. The vast majority of Java features (from the VM and the core libraries to the compiler) are based solely on this source repository. Oracle have an alternate fork of this.

OpenJDK, the distribution (see the list of providers below) - is free as in beer and kind of free as in speech, but, you do not get to call Oracle if you have problems with it. There is no support contract. Furthermore, Oracle will only release updates to any OpenJDK (the distribution) version if that release is the most recent Java release, including LTS (long-term support) releases. The day Oracle releases OpenJDK (the distribution) version 12.0, even if there's a security issue with OpenJDK (the distribution) version 11.0, Oracle will not release an update for 11.0. Maintained solely by Oracle.

Some OpenJDK projects - such as OpenJDK 8 and OpenJDK 11 - are maintained by the OpenJDK community and provide releases for some OpenJDK versions for some platforms. The community members have taken responsibility for releasing fixes for security vulnerabilities in these OpenJDK versions.

AdoptOpenJDK, the distribution is very similar to Oracle's OpenJDK distribution (in that it is free, and it is a build produced by compiling the sources from the OpenJDK source repository). AdoptOpenJDK as an entity will not be backporting patches, i.e. there won't be an AdoptOpenJDK 'fork/version' that is materially different from upstream (except for some build script patches for things like Win32 support). Meaning, if members of the community (Oracle or others, but not AdoptOpenJDK as an entity) backport security fixes to updates of OpenJDK LTS versions, then AdoptOpenJDK will provide builds for those. Maintained by OpenJDK community.

OracleJDK - is yet another distribution. Starting with JDK12 there will be no free version of OracleJDK. Oracle's JDK distribution offering is intended for commercial support. You pay for this, but then you get to rely on Oracle for support. Unlike Oracle's OpenJDK offering, OracleJDK comes with longer support for LTS versions. As a developer you can get a free license for personal/development use only of this particular JDK, but that's mostly a red herring, as 'just the binary' is basically the same as the OpenJDK binary. I guess it means you can download security-patched versions of LTS JDKs from Oracle's websites as long as you promise not to use them commercially.

Note. It may be best to call the OpenJDK builds by Oracle the "Oracle OpenJDK builds".

Donald Smith, Java product manager at Oracle writes:

Ideally, we would simply refer to all Oracle JDK builds as the "Oracle JDK", either under the GPL or the commercial license, depending on your situation. However, for historical reasons, while the small remaining differences exist, we will refer to them separately as Oracle’s OpenJDK builds and the Oracle JDK.


OpenJDK Providers and Comparison

----------------------------------------------------------------------------------------
|     Provider      | Free Builds | Free Binary   | Extended | Commercial | Permissive |
|                   | from Source | Distributions | Updates  | Support    | License    |
|--------------------------------------------------------------------------------------|
| AdoptOpenJDK      |    Yes      |    Yes        |   Yes    |   No       |   Yes      |
| Amazon – Corretto |    Yes      |    Yes        |   Yes    |   No       |   Yes      |
| Azul Zulu         |    No       |    Yes        |   Yes    |   Yes      |   Yes      |
| BellSoft Liberica |    No       |    Yes        |   Yes    |   Yes      |   Yes      |
| IBM               |    No       |    No         |   Yes    |   Yes      |   Yes      |
| jClarity          |    No       |    No         |   Yes    |   Yes      |   Yes      |
| OpenJDK           |    Yes      |    Yes        |   Yes    |   No       |   Yes      |
| Oracle JDK        |    No       |    Yes        |   No**   |   Yes      |   No       |
| Oracle OpenJDK    |    Yes      |    Yes        |   No     |   No       |   Yes      |
| ojdkbuild         |    Yes      |    Yes        |   No     |   No       |   Yes      |
| RedHat            |    Yes      |    Yes        |   Yes    |   Yes      |   Yes      |
| SapMachine        |    Yes      |    Yes        |   Yes    |   Yes      |   Yes      |
----------------------------------------------------------------------------------------

Free Builds from Source - the distribution source code is publicly available and one can assemble its own build

Free Binary Distributions - the distribution binaries are publicly available for download and usage

Extended Updates - aka LTS (long-term support) - Public Updates beyond the 6-month release lifecycle

Commercial Support - some providers offer extended updates and customer support to paying customers, e.g. Oracle JDK (support details)

Permissive License - the distribution license is non-protective, e.g. Apache 2.0


Which Java Distribution Should I Use?

In the Sun/Oracle days, it was usually Sun/Oracle producing the proprietary downstream JDK distributions based on OpenJDK sources. Recently, Oracle had decided to do their own proprietary builds only with the commercial support attached. They graciously publish the OpenJDK builds as well on their https://jdk.java.net/ site.

What is happening starting JDK 11 is the shift from single-vendor (Oracle) mindset to the mindset where you select a provider that gives you a distribution for the product, under the conditions you like: platforms they build for, frequency and promptness of releases, how support is structured, etc. If you don't trust any of existing vendors, you can even build OpenJDK yourself.

Each build of OpenJDK is usually made from the same original upstream source repository (OpenJDK “the project”). However each build is quite unique - $free or commercial, branded or unbranded, pure or bundled (e.g., BellSoft Liberica JDK offers bundled JavaFX, which was removed from Oracle builds starting JDK 11).

If no environment (e.g., Linux) and/or license requirement defines specific distribution and if you want the most standard JDK build, then probably the best option is to use OpenJDK by Oracle or AdoptOpenJDK.


Additional information

Time to look beyond Oracle's JDK by Stephen Colebourne

Java Is Still Free by Java Champions community (published on September 17, 2018)

Java is Still Free 2.0.0 by Java Champions community (published on March 3, 2019)

Aleksey Shipilev about JDK updates interview by Opsian (published on June 27, 2019)

A876
  • 393
  • 3
  • 7
Mikhail Kholodkov
  • 17,248
  • 15
  • 52
  • 69
  • 8
    You might add a mention that other vendors provide Java implementations based on OpenJDK such as the *Zulu* and *Zing* products from [Azul Systems](http://www.Azul.com/). Another is the [Eclipse OpenJ9](https://developer.ibm.com/code/open/projects/eclipse-openj9/) project. – Basil Bourque Sep 20 '18 at 20:07
  • What's the difference between free builds from source and free distribution binaries columns? – Didier A. Jul 09 '19 at 23:04
  • What isn't clear is what "support" means. Doesn't that mean that the vendor might apply patches or backport fixes which are not applied to the OpenJDK source ? Thus not all OpenJDK builds are made from the same exact source, as some vendors might apply their own fixes on top and might not contribute it back upstream? – Didier A. Jul 09 '19 at 23:05
  • From AdoptOpenJDK page, I still don't clearly understand, what is the license to use its JVM for running Java applications. Is it Apache 2.0 (good, permissive license), or GPLv2 + CE (strict, available only for free programs)? – Dmitriy Popov Aug 06 '19 at 10:18
  • 2
    @DmitriyPopov It is permissive - https://github.com/AdoptOpenJDK/openjdk-build/blob/master/LICENSE – Mikhail Kholodkov Aug 06 '19 at 10:28
  • Further confusing this is that the [OpenJDK 11 download page](https://jdk.java.net/java-se-ri/11) claims the binaries are for "reference use only", and only provide the original build 11+28. On the [OpenJDK 11 updates page](https://wiki.openjdk.java.net/display/JDKUpdates/JDK11u) the build binaries link out to the [AdoptOpenJDK GitHub releases](https://github.com/AdoptOpenJDK/openjdk11-upstream-binaries/releases/)! Does this mean that OpenJDK will not be providing updates (security updates, bug fixes) for each release, but that they are only available through AdoptOpenJDK? – Garret Wilson Dec 17 '19 at 15:11
  • 1
    @MikhailKholodkov Incorrect about Apache licensing. Your link to AdoptOpenJDK using Apache License 2.0 applies only to the build scripts they authored to help produce their binaries. The binaries are built from source code obtained from the OpenJDK project using the GPL with linking exception license. – Basil Bourque Jan 10 '20 at 17:04
  • 3
    @GarrettWilson AdoptOpenJDK does only 2 things: (a) Build binaries & installers using source code provides by OpenJDK, and (b) Run tests on those binaries. AdoptOpenJDK does *not* maintain a repository of source code for implementing the Java platform. So: OpenJDK is only source code, AdoptOpenJDK is only binaries+installers. AdoptOpenJDK authors code only for their building tools & test suites. Besides AdoptOpenJDK, several other companies also provide builds based on the source code provided by the OpenJDK project: Azul Systems, Oracle, BellSoft, Amazon AWS, RedHat/IBM, SAP, and more. – Basil Bourque Jan 10 '20 at 17:16
  • 2
    @GarretWilson I should add that AdoptOpenJDK does a third thing: (c) [Creates and maintains tooling](https://github.com/AdoptOpenJDK/) to support the building & testing mentioned in my previous comment. – Basil Bourque Apr 20 '20 at 19:38
  • 1
    Here is a comparison matrix also, can you add it too? https://www.azul.com/products/zulu-enterprise/jdk-comparison-matrix/ – Evren Yurtesen May 22 '20 at 13:32
103

Update: AdoptOpenJDK has changed its name to Adoptium, as part of its move to the Eclipse Foundation.


OpenJDK ➙ source code
Adoptium/AdoptOpenJDK ➙ builds

Difference between OpenJDK and AdoptOpenJDK

The first provides source-code, the other provides builds of that source-code.

Several vendors of Java & OpenJDK

Adoptium of the Eclipse Foundation, formerly known as AdoptOpenJDK, is only one of several vendors distributing implementations of the Java platform. These include:

  • Eclipse Foundation (Adoptium/AdoptOpenJDK)
  • Azul Systems
  • Oracle
  • Red Hat / IBM
  • BellSoft
  • SAP
  • Amazon AWS
  • … and more

See this flowchart of mine to help guide you in picking a vendor for an implementation of the Java platform. Click/tap to zoom.

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

Another resource: This comparison matrix by Azul Systems is useful, and seems true and fair to my mind.

Here is a list of considerations and motivations to consider in choosing a vendor and implementation.

Motivations in choosing a vendor for Java

Some vendors offer you a choice of JIT technologies.

Diagram showing history of HotSpot & JRockit merging, and OpenJ9 both available in AdoptOpenJDK

To understand more about this Java ecosystem, read Java Is Still Free

Basil Bourque
  • 218,480
  • 72
  • 657
  • 915
  • @iCurious Try again. Not broken for me. Images reside on Stack Exchange company’s dedicated site at Imgur.com. – Basil Bourque Dec 24 '19 at 17:23
  • 1
    If 'OpenJDK' refers to the source, then what is the difference between https://hub.docker.com/_/openjdk and https://hub.docker.com/_/adoptopenjdk? – bcoughlan Jan 15 '20 at 13:13
  • 1
    @bcoughlan You would have to ask the publisher of those two products: Docker, Inc. Your linked web pages claim that the second is maintained by the AdoptOpenJDK project, while the first is maintained by "the Docker Community". The first one is misleading in its use of the logo and naming as it may have given you the impression that the OpenJDK project produced it, which is not the case. The first may even be violating the [item # 2 of the trademark notice given by OpenJDK](https://openjdk.java.net/legal/openjdk-trademark-notice.html), but I am not an attorney. – Basil Bourque Jan 16 '20 at 00:09
  • I very much appreciate this well-documented answer, but I can go to the OpenJDK website and download an OpenJDK build. Their support is very limited (limited support windows, limited support SLAs), but good enough for a lot of users. I think AdoptOpenJDK is the better choice regardless, but this answer seems incomplete without acknowledging OpenJDK builds. For reference, I consider [this document](https://medium.com/@javachampions/java-is-still-free-2-0-0-6b9aa8d6d244) enlightening and authoritive on the matter. – Sander Verhagen Apr 26 '20 at 08:22
  • 1
    @SanderVerhagen Can you provide a link to that download page at the OpenJDK site? I find no such offer. I do find a link to Oracle's OpenJDK JDK binaries for Windows, macOS, and Linux on another web site: https://jdk.java.net/. That site and its binary downloads are provided as a courtesy to the community by Oracle, not by the OpenJDK project. As the [home page](https://jdk.java.net/) says: *Java Development Kit builds, from Oracle*. I show this product as the second bubble in the blue barrel of my flowchart, upper-right corner. – Basil Bourque Apr 26 '20 at 14:47
  • I'm not saying the OpenJDK binaries aren't built by Oracle, I believe they are (download [here](https://jdk.java.net/14/)). I just believe they are a different product than Oracle JDK (download [here](https://www.oracle.com/java/technologies/javase-jdk14-downloads.html)). (And "different product" could very well be "mostly the same bytes, wrapped in a different license".) – Sander Verhagen Apr 26 '20 at 18:55
  • 1
    @SanderVerhagen Your link leads to *a different web site*, as I suspected, **outside of OpenJDK**. The site https://jdk.java.net/14/ is ***not*** part of the OpenJDK web site, nor is it part of the OpenJDK project. In other words, https://openjdk.java.net/ is not https://jdk.java.net/. Again, look at the two bubbles at the top of the blue barrel in my flowchart. The Oracle product in upper-left is their commercial product. The Oracle product in the upper-right is their GPL-licensed free-of-cost build — your link leads to this particular product. – Basil Bourque Apr 26 '20 at 19:06
  • Fair enough about the bubbles, but you start by saying: "OpenJDK ➙ source code", I think that is misleading. – Sander Verhagen Apr 26 '20 at 19:14
  • 1
    @SanderVerhagen I suspect you are being confused by the product naming. The word “Java” is trademarked by Oracle, and can only be used with their permission. Most vendors are therefore not using that trademark. Instead most vendors are using the term “OpenJDK” as part of their naming, rather than “Java”. These vendors are making their builds from source code obtained from the *OpenJDK* project. The ***OpenJDK* project provides only source code**, not builds, not installers. For a build/installer you must either make your own or obtain one from a vendor. I suggest reading *Java Is Still Free*. – Basil Bourque Apr 26 '20 at 19:21
  • The question was about OpenJDK, not "the OpenJDK project". When you install OpenJDK, say using `apt-get install openjdk-11-jdk`, you get binaries, under a free, permissive license. Those are the OpenJDK libraries, for all intents and purposes, even if they're built by Oracle. _Java Is Still Free_, not only did I read that article, I linked to it in my first reply. – Sander Verhagen Apr 27 '20 at 04:36
  • 1
    @SanderVerhagen Section 1(a) of the [OpenJDK Trademark Notice](https://openjdk.java.net/legal/openjdk-trademark-notice.html) allows third-parties such as *apt-get* to use “the Name in the package names and version strings” of binaries built substantially from the source code provided by the OpenJDK project, under some conditions. If by “free” you meant free-of-cost, that is not necessarily the case when you see the word "openjdk" in the name. I believe it is very important for anyone obtaining software such as a Java implementation be very clear as to its origins, its licensing, and its terms. – Basil Bourque May 15 '20 at 21:37