Difference between Oracle JDK and OpenJDK

Tram Ho

Surely anyone who starts learning Java will have to install the JDK toolkit that provides the software development environment for Java applications. The JDK includes the JRE (Java Runtime Environment), and a number of other tools for Java application development.

Most of you search for and download Oracle’s JDK. However, there is still a different version of JDK called OpenJDK and let’s find out how they are different.

Development history java SE

Here is the development history of Java SE (standard edition), Enterprise and Micro editions will also be included.

  • JDK Beta – 1995
  • JDK 1.0 – January 1996
  • JDK 1.1 – February 1997
  • J2SE 1.2 – December 1998
  • J2SE 1.3 – May 2000
  • J2SE 1.4 – February 2002
  • J2SE 5.0 – September 2004
  • Java SE 6 – December 2006
  • Java SE 7 – July 2011
  • Java SE 8 (LTS) – March 2014
  • Java SE 9 – September 2017
  • Java SE 10 (18.3) – March 2018
  • Java SE 11 (18.9 LTS) – September 2018
  • Java SE 12 (19.3) – March 2019

Versions that are italicized in the sense are no longer supported by oracle. LTS – Long-Term-support means long-term support.

You can see that Java SE versions are released approximately every 2 years, up to Java SE 6 it takes 5 years to get Java SE 7 and 3 years to release Java SE 8, one of the most used versions today.

Starting with Java SE 10, release versions can be 6 months apart, and there will be a long-term supported version every 3 years.

Java SE 11 is currently the highest end long term supported version (LTS), and Java SE 8 will receive free updates until December 2020 for non-commercial use.

Oracle encourages the use of JDKs for the long term supported versions of Java SE such as Java SE 8 and 11.

Previously the JDK versions were called SUN JDK, and after oracle acquired Sun Microsystems in 2010 it could officially be named JDK.

OpenJDK

From Java SE 7, an open source development community named OpenJDK is based on Java SE 7. The interfaces of each of the new versions are still defined by Oracle, but we will have 2 implementations from OpenJDK with community support and an instance from Oracle.

OpenJDK is a free source code version developed based on Java SE. It was first released in 2007 by Microsystems. Developed based on Java SE version 7.

Like Oracle, OpenJDK releases new versions every 6 months. Let’s take a look at the development of OpenJDK.

  • OpenJDK 6 project – based on JDK 7, but modified to provide an open-source version of Java 6
  • OpenJDK 7 projects – 28 July 2011
  • OpenJDK 7u project – this project develops updates to Java Development Kit 7
  • OpenJDK 8 projects – 18 March 2014
  • OpenJDK 8u project – this project develops updates to Java Development Kit 8
  • OpenJDK 9 project – September 21, 2017
  • JDK project release 10 – 20 March 2018
  • JDK project release 11 – 25 September 2018
  • JDK project release 12 – Stabilization phase

Compare Oracle JDK with OpenJDK

In this section we will compare the difference between Oracle JDK and OpenJDK according to each criteria below.

Release time

Although Oracle recently announced a 6-month release, it only takes about 3 years to have an LTS version. While OpenJDK released 6 months for each new version.

Oracle will provide long-term support for the versions they release while OpenJDK only supports the period when that version is released until a new version is available, which means it only supports 6 months.

License

Oracle JDK is licensed with Oracle Binary Code License Agreement while OpenJDK is OpenJDK has the GNU General Public License (GNU GPL) version 2 with a linking exception.

Performance

Regarding the process of updating new versions, there is no difference between Oracle JDK and OpenJDK because each newly released version will have 2 deployment versions of oracle and openjdk.

But in terms of performance, Oracle is better than OpenJDK, they focus on stability to support individual, corporate, etc. In contrast to OpenJDK, versions are released more often, so sometimes we run into problems. Of course OpenJDK is a version developed by the community, if you can afford and enjoy the game, do not hesitate to use OpenJDK.

Popularity and community

Oracle JDK was developed by Oracle Corporation as a product of the company. While OpenJDK is also being developed by Oracle, there is also a community involved in the development of OpenJDK. Big companies like Red Hat, Azul Systems, IBM, Apple Inc etc are also actively involved in the development of OpenJDK.

In the past, oracle’s JDK version was used more often, but recently there has been a major change. Typically Android Studio and IntellIJ IDEA used Oracle JDK but now they have switched to OpenJDK. On the other hand, major operating systems from the Linux branch such as Ubuntu, Fedora, and Red Hat use OpenJDK as the default Java SE implementation.

Changes from Java 11

We can see on the Oracle Blog that some important changes have been made since Java 11. Oracle will change the license with the combination of the GNU General Public License v2, with the Classpath Exception ( GPLv2 + CPE) and commercial license when using Oracle JDK in enterprise applications.

Oracle’s kit for Java 11 will warn when using -XX: + UnlockCommercialFeatures option, while using this option with OpenJDK will result in an error. Oracle JDK allows the use of data logs in the Advanced Management Console tool. Oracke requires a third cryptographic providers library to confirm the license. While OpenJDK it is just an option.

Reference source

https://shareprogramming.net/su-khac-nhau-giua-oracle-jdk-va-openjdk/

Share the news now

Source : Viblo