OpenJDK vs Oracle JDK

Solution Verified - Updated

Environment

  • OpenJDK
  • OracleJDK

Issue

  • Any differences between the Red Hat OpenJDK and the Oracle JDK?
  • Any factors to consider when migrating from Oracle JDK to OpenJDK?

Resolution

Following is a basic list and not specific to any java version.

  • Font: The font library is different. This means slightly different text layout in some cases. Oracle JDK 8 is distributed with a font, while OpenJDK 8 relies on at least one font being available in the system. Neither OpenJDK 11+ or Oracle JDK 11+ have fonts embedded.

  • CMS: Same for the colour management system. OpenJDK uses the same solutions as the rest of RHEL (FreeType & LCMS) while the proprietary JDK has established existing code that it has used for many years.

  • OpenJDK can use the RHEL system NSS crypto library, instead of the JDK's built-in one. This mostly affects elliptic curve cryptography, where OpenJDK supports all of the RHEL curves and none of the others.

  • 2D library: OpenJDK has its own 2D library, different from the proprietary JDK. This means that its performance may differ.

  • Application Class Data Sharing is part of OpenJDK since OpenJDK 10. This feature reduces the memory footprint by sharing class metadata.

  • OpenJDK doesn't support the Resource Management API for Java.

  • OpenJDK doesn't support the Simple Network Management Protocol API.

  • OpenJDK has its own browser plugin and Java Web Start application (icedtea-web package), written independently of Oracle. Icedtea-web is currently supported on RHEL with OpenJDK 7 and OpenJDK 8 and on Windows with OpenJDK 8. However, following Oracle's path, IcedTea-Web is being deprecated on OpenJDK 11.

  • OpenJDK doesn't support Cooperative Memory Management. This allows the user to tune the G1 garbage collector depending on a compromise between memory usage and performance. Cooperative Memory Management was deprecated for removal with no replacement in JDK10 and removed in JDK11.

  • OpenJDK supports system-tap.

  • OpenJDK is provided with full-debug clone-build (-debug- subpackages).

  • OpenJDK comes with javadocs. Both zipped and uncompressed.

  • OpenJDK is delivered with full sources.

  • OpenJDK uses system tzdata and system certificates (Oracle has these bundled).

  • OpenJDK 8 and 11 from Red Hat fully support Shenandoah, a low pausetime Garbage Collector for large heaps.

  • OpenJDK Jave Flight Recorder (JFR) is a different internal implementation than Oracle JDK in 8u, and was backported from the implementation available in OpenJDK 11; furthermore, it is only available starting from OpenJDK 8u262. The implementation of JFR is missing in OpenJDK 9 and 10. Since 11 both OpenJDK and Oracle JDK have the same implementation.

  • The Red Hat build of OpenJDK8 32-bit build for RHEL7 does not include the client VM.

  • The com.sun.image.codec.jpeg package is not included in OpenJDK because it has a 3rd party license that prevents open-sourcing it.

  • The Red Hat build of OpenJDK distribution does not include JavaFX/OpenJFX.

  • JDK8 minor release numbers are different. The OpenJDK minor release number is 1 more than Oracle. For example, the January 2025 JDK8 quarterly release is update 442 for OpenJDK and update 441 for Oracle.

Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.