The difference between Oracle JDK and OpenJDK

Overview

There are many implementations of Java Development Kits (JDKs) but the two most prominent ones are Oracle JDK and Open JDK. This shot will cover the differences between them.

To read more about JDKs, please refer to this shot.

Currently, Oracle is working towards a goal to keep both OpenJDK and Oracle JDK binaries as close as possible. With Java 17, there are only a few key differences between them.

Differences

Oracle JDK

OpenJDK

  • Oracle JDK is the proprietary implementation of Java.

  • Free to use for both commercial and non-commercial purposes.

  • Oracle JDK binaries are free to use for commercial and non-commercial purposes and are released under the Oracle No-Fee Terms and Conditions License.

  • Oracle JDK is by default Java distribution for Solaris, Windows, AIX, and macOS.

  • Oracle JDK offers “installers” (msi, rpm, deb, etcetera), which not only place the JDK binaries in our system but also contain update rules and, in some cases, handle some common configurations like set common environmental variables, such as JAVA_HOME in Windows, and establish file associations, such as “use java to launch .jar files”.

  • It distributes FreeType with FreeType license.

  • Usage logging features are supported.

  • OpenJDK is an open-source implementation.

  • Free to use for both commercial and non-commercial purposes.

  • OpenJDK binaries are released under the GNU General Public License version 2, with the Class path Exception (GPLv2wCP).

  • OpenJDK is the default Java distribution for Linux Ubuntu, Fedora, Red Hat Enterprise Linux (RHEL), and OpenSUSE distributions.

  • OpenJDK is only offered as a compressed archive (tar.gz or .zip). We need to manually perform the common configuration tasks and set file associations.

  • Usage logging features are not available.

  • It distributes FreeType with GPLv2 license .

Conclusion

In this shot, we discussed the differences between OpenJDK and Oracle JDK. To try out the latest features of Java 17, we can use any of the distributions. OpenJDK is a good choice for doing post-install configuration. If we want an installer with which we don’t have to worry about post-install configurations, then Oracle JDK can be a preferred better option.