Differences Between Oracle Jdk and Openjdk

Differences between Oracle JDK and OpenJDK

Both OpenJDK and Oracle JDK are created and maintained currently by Oracle only.

OpenJDK and Oracle JDK are implementations of the same Java specification passed the TCK (Java Technology Certification Kit).

Most of the vendors of JDK are written on top of OpenJDK by doing a few tweaks to [mostly to replace licensed proprietary parts / replace with more high-performance items that only work on specific OS] components without breaking the TCK compatibility.

Many vendors implemented the Java specification and got TCK passed. For example, IBM J9, Azul Zulu, Azul Zing, and Oracle JDK.

Almost every existing JDK is derived from OpenJDK.

As suggested by many, licensing is a change between JDKs.

Starting with JDK 11 accessing the long time support Oracle JDK/Java SE will now require a commercial license. You should now pay attention to which JDK you're installing as Oracle JDK without subscription could stop working. source

Ref: List of Java virtual machines

Technically what is the main difference between Oracle JDK and OpenJDK?

Technical differences are a consequence of the goal of each one (OpenJDK is meant to be the reference implementation, open to the community, while Oracle is meant to be a commercial one)

They both have "almost" the same code of the classes in the Java API; but the code for the virtual machine itself is actually different, and when it comes to libraries, OpenJDK tends to use open libraries while Oracle tends to use closed ones; for instance, the font library.

Difference between OpenJDK and Adoptium/AdoptOpenJDK

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 https://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
https://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




























































































































ProviderFree Builds
from Source
Free Binary
Distributions
Extended
Updates
Commercial
Support
Permissive
License
Website
AdoptOpenJDKYesYesYesNoYeshttps://adoptopenjdk.net
Amazon – CorrettoYesYesYesNoYeshttps://aws.amazon.com/corretto
Azul ZuluNoYesYesYesYeshttps://www.azul.com/downloads/zulu/
BellSoft LibericaNoYesYesYesYeshttps://bell-sw.com/java.html
IBMNoNoYesYesYeshttps://www.ibm.com/developerworks/java/jdk
jClarityNoNoYesYesYeshttps://www.jclarity.com/adoptopenjdk-support/
OpenJDKYesYesYesNoYeshttps://adoptopenjdk.net/upstream.html
Oracle JDKNoYesNo**YesNohttps://www.oracle.com/technetwork/java/javase/downloads
Oracle OpenJDKYesYesNoNoYeshttps://jdk.java.net
ojdkbuildYesYesNoNoYeshttps://github.com/ojdkbuild/ojdkbuild
RedHatYesYesYesYesYeshttps://developers.redhat.com/products/openjdk/overview
SapMachineYesYesYesYesYeshttps://sap.github.io/SapMachine

What is the reason to use OpenJDK?

November 2017: At the time this question was asked, the reasons for choosing between OpenJDK and Oracle JDK include:

  • Availability of builds / installers for specific platforms. For example, last time I checked there were no Oracle JDK distros in ".deb" format for Debian / Ubuntu. And no OpenJDK builds for Windows.

  • Oracle JDK has some commercial features that can be enabled by people who have paid. They are not present on OpenJDK.

  • Oracle JDK has an annoying click-through license. This is a pain if you are trying to automate deployment; e.g. to cloud VMs. By contrast, OpenJDK on Linux (at least) can be installed and updated using the platform's package manager.

  • There may be issues if you wanted commercial support for OpenJDK.

There were no substantive license differences between Oracle JDK and OpenJDK if you just plan to use the software. (There are some constraints on binary redistribution for Oracle JDK, but they are about shipping non-standard or stripped-down versions of the Java platform.)

In the future, some of these differences will go away, according to this blog page:

  • Faster and Easier Use and Redistribution of Java SE

Update in December 2018:

  • As of January 2019, Oracle JDK Java 8 will be EOL for commercial uses. (But free support will continue until January 2020 for personal use.)
    1

  • Java 9 and Java 10 are EOL.

  • Commercial uses of Oracle JDK Java 11 and later require a support contract or a subscription from Oracle. OpenJDK Java builds do not have this requirement.

  • Oracle do not provide support for OpenJDK Java builds, but support is available from 3rd parties. Third parties will also port Oracle security fixes to OpenJDK builds.

Further reading:

  • Java Is Still Free
  • OpenJDK Life Cycle and Support Policy (RedHat)
  • The future of Java and OpenJDK updates without Oracle support
  • What has changed in Java Release and Update Availability? (Azul Systems)
  • AdoptOpenJDK Support

1
EOL stands for end-of-life.
An end-of-life (EOL) product is a product that does not receive continuing support, either because existing marketing, support and other processes are terminated, or it is at the end of its useful life.

In JDK11 where is the difference between Oracle's source code and openJDK's source code

There aren't any source differences; there's only one source tree.

The difference lies in the support contract (and occasionally, the Oracle JDK packs in a few more external things, generally because they aren't open source, naturally, you can't find the source tree of these addons, though oracle is working on reducing this to zero.

For example, Flight Recorder was part of Oracle JDK and not OpenJDK originally, but has been part of OpenJDK since Java 11.



Related Topics



Leave a reply



Submit