What Really Differentiates Oracle JDK from OpenJDK? A Deep Dive
This article explains that Oracle JDK and OpenJDK share the same HotSpot VM codebase, with only a few private Oracle components such as Java Flight Recorder and specific platform ports, and highlights differences in packaging, historical version sync, and minor feature gaps.
Oracle JDK and OpenJDK both use the HotSpot VM, essentially the same codebase.
Since JDK 7, the HotSpot VM in Oracle JDK is built from the same Mercurial repository as OpenJDK, meaning they share the identical source code visible to the public.
Only a very small amount of functionality is absent from OpenJDK; these private parts reside in Oracle's internal repository and do not affect the core JVM.
To build Oracle JDK, an Oracle employee checks out the OpenJDK source from http://hg.openjdk.java.net, then pulls the private components from Oracle's internal codebase and places them in a specific directory before building.
The private components mainly include the internal implementation of Java Flight Recorder and some platform ports that are not open-sourced, such as Oracle's ARM and PPC versions of HotSpot.
For JDK 6, Sun JDK 6 and OpenJDK 6 were not synchronized, but their HotSpot VMs remained largely consistent. OpenJDK 6 lacks the -XX:+UseCompressedString optimization found only in Oracle JDK 6.
Version timing differences can also cause minor discrepancies; for example, tiered compilation is present in Oracle/Sun JDK 6u25 but was missing in the corresponding OpenJDK 6 release, while it appeared later in the OpenJDK 7 branch.
Oracle JDK is distributed only as binary installers, whereas OpenJDK is released solely as source code.
Understanding these nuances helps developers choose the appropriate JDK for their projects.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Programmer DD
A tinkering programmer and author of "Spring Cloud Microservices in Action"
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
