Reputation: 19729
NOTE: This question is from 2014. As of Java 11 OpenJDK and Oracle JDK are converging.
Are there any crucial differences between Oracle and OpenJDK?
For example, are the garbage collection and other JVM parameters the same?
Does GC work differently between the two?
Upvotes: 837
Views: 693262
Reputation: 340040
Oracle JDK | OpenJDK |
---|---|
A commercial software product implementing the Java specifications, released by Oracle Corp. | An open-source project with complete source code for implementing the Java specifications. Owned by Oracle, in a joint effort with IBM, Apple, Red Hat, and others. |
Based virtually entirely on the source code available at the OpenJDK project, with feature parity. One of multiple lines of JDK/JRE products available from Oracle; see also their non-commercial Oracle OpenJDK Builds and their GraalVM product lines. | Produces only source code. Does not produce binaries or installers (except for early-access previews). For production-quality binaries/installers, see any of the several JDK/JRE vendors. |
OpenJDK is an open-source project. OpenJDK publishes source code, not binaries, not installers. OpenJDK is owned by Oracle, but is a joint effort with major contributors including IBM, Apple, Red Hat, and others.
Several vendors offer JDK/JRE products based largely, if not entirely, on the codebase of OpenJDK. These include:
For example, Azul offers various lines of JDK/JRE products such as Azul Zulu and Azul Zing.
Similarly, Oracle offers multiple lines of JDK/JRE products:
Your confusion may come from the fact that Oracle, the owner of the Java™ trademark and owner of the OpenJDK project, gives permission to the various JDK/JRE vendors to use the term “OpenJDK” in their product names if they so choose.
For full details, see Java Is Still Free.
Upvotes: 0
Reputation: 24202
For Java 7, nothing crucial. The OpenJDK project is mostly based on HotSpot source code donated by Sun.
Moreover, OpenJDK was selected to be the reference implementation for Java 7 and is maintained by Oracle engineers.
There's a more detailed answer from 2012 on difference between JVM, JDK, JRE & OpenJDK, which links to an Oracle blog post:
Q: What is the difference between the source code found in the OpenJDK repository, and the code you use to build the Oracle JDK?
A: It is very close - our build process for Oracle JDK releases builds on OpenJDK 7 by adding just a couple of pieces, like the deployment code, which includes Oracle's implementation of the Java Plugin and Java WebStart, as well as some closed source third party components like a graphics rasterizer, some open source third party components, like Rhino, and a few bits and pieces here and there, like additional documentation or third party fonts. Moving forward, our intent is to open source all pieces of the Oracle JDK except those that we consider commercial features such as JRockit Mission Control (not yet available in Oracle JDK), and replace encumbered third party components with open source alternatives to achieve closer parity between the code bases.
Upvotes: 348
Reputation: 2312
OpenJDK
Oracle JDK
Source: https://o7planning.org/12571/history-of-java-and-the-difference-between-oracle-jdk-and-openjdk
Upvotes: 5
Reputation: 1
It is very close - our build process for Oracle JDK releases builds on OpenJDK 7 by adding just a couple of pieces, like the deployment code, which includes Oracle's implementation of the Java Plugin and Java WebStart, as well as some closed source third-party components like a graphics rasterizer, some open-source third party components, like Rhino, and a few bits and pieces here and there, like additional documentation or third-party fonts. Moving forward, we intend to open source all pieces of the Oracle JDK except those that we consider commercial features such as JRockit Mission Control (not yet available in Oracle JDK) and replace encumbered third-party components with open source alternatives to achieve closer parity between the codebases.
· Yes, the garbage collection and other JVM parameters are the same.
· The performance of GC is the same in both.
Upvotes: 0
Reputation: 692
My understanding is that Oracle JDK can't be used in production, therefore I cannot legally use it (without paying), for the web application I am building for my company. I have to use OpenJDK. Please correct me if I am wrong! From this article.
Starting with Java 11, the Oracle JDK is restricted to development and testing environments. Oracle JDKs may only be used in production if you buy the commercial support. Instead, Oracle will provide Java builds based on OpenJDK for free which can be used in production. But for the official Oracle JDK the real roadmap will look like this:
UPDATE: I'm wrong. I can use Oracle JDK for free but won't get security updates after 6 mos and we'll have to assume the risk. Look at the above linked article section "What does the new release train mean to my company?".
Upvotes: 2
Reputation: 2367
From Java 11 turn to a big change
Oracle will change its historical “BCL” license with a combination of an open source and commercial license
Update : 25-Aug-2019
for more details oracle-vs-openjdk
Upvotes: 18
Reputation: 90150
Aside from the obvious licensing difference, the major difference between OpenJDK and OracleJDK 11 are stability and performance updates.
Source: https://www.youtube.com/watch?v=Adv9--6IcQI&t=385
Every 6 months the two codebases will be in-sync. But during the 6 month window OpenJDK will only receive security updates while OracleJDK will receive additional stability and performance updates.
Given that update releases only occur every 3 months for both OpenJDK and OracleJDK this means that you are missing out on (at most) 3 months worth of fixes until the next major release comes out and you upgrade. However, if you choose to stick to LTS releases then a commercial license begins to make more sense.
Upvotes: 9
Reputation: 591
For Java 8, Oracle JDK vs. OpenJDK my take of key differences:
OpenJDK is an open source implementation of the Java Standard Edition platform with contribution from Oracle and the open Java community.
OpenJDK is released under license GPL v2 wherein Oracle JDK is licensed under Oracle Binary Code License Agreement.
Actually, Oracle JDK’s build process builds from OpenJDK source code. So there is no major technical difference between Oracle JDK and OpenJDK. Apart from the base code, Oracle JDK includes, Oracle’s implementation of Java Plugin and Java WebStart. It also includes third-party closed source and open source components like graphics rasterizer and Rhino respectively. OpenJDK Font Renderer and Oracle JDK Flight Recorder are the noticeable major differences between Oracle JDK and OpenJDK.
For a full list of differences please see the source article: Oracle JDK vs OpenJDK and Java JDK Development Process
Upvotes: 49
Reputation: 4597
According to the oracle blog, Oracle JDK Releases for Java 11 and Later
Starting with Java 11, Oracle will provide JDK releases under the open source GNU General Public License v2, with the Classpath Exception (GPLv2+CPE), and under a commercial license for those using the Oracle JDK as part of an Oracle product or service, or who do not wish to use open source software. This combination of using an open source license and a commercial license replaces the historical “BCL” license, which had a combination of free and paid commercial terms.
Different builds will be provided for each license, but these builds are functionally identical aside from some cosmetic and packaging differences, described in detail below.
From the BCL to the GPL
The Binary Code License for Oracle Java SE technologies (“BCL”) has been the primary license for Oracle Java SE technologies for well over a decade. The BCL permits use without license fees under certain conditions. To simplify things going forward, Oracle started providing open source licensed OpenJDK builds as of Java 9, using the same license model as the Linux platform. If you are used to getting Oracle Java SE binaries for free, you can simply continue doing so with Oracle’s OpenJDK builds available at jdk.java.net. If you are used to getting Oracle Java SE binaries as part of a commercial product or service from Oracle, then you can continue to get Oracle JDK releases through My Oracle Support (MOS), and other locations.
Functionally identical and interchangeable...
Oracle’s BCL-licensed JDK historically contained “commercial features” that were not available in OpenJDK builds. As promised, however, over the past year Oracle has contributed these features to the OpenJDK Community, including:
From Java 11 forward, therefore, Oracle JDK builds and OpenJDK builds will be essentially identical.
...yet with some cosmetic and packaging differences
There do remain a small number of differences, some intentional and cosmetic, and some simply because more time to discuss with OpenJDK contributors is warranted.
This difference remains in order to provide a consistent experience for specific kinds of legacy use. These modules are either now available separately as part of OpenJFX, are now in both OpenJDK and the Oracle JDK because they were commercial features which Oracle contributed to OpenJDK (e.g., Flight Recorder), or were removed from Oracle JDK 11 (e.g., JNLP).
java 11 2018-09-25
Java(TM) SE Runtime Environment 18.9 (build 11+28)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11+28, mixed mode)
And for an OpenJDK 11 build:
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
Upvotes: 27
Reputation: 6950
Also for Java 8 an interesting performance benchmark for reactive (non-blocking) Spring Boot REST application being hosted on various JVMs by AMIS Technology Blog has been published in Nov 2018 showing that, among other differences:
For details please see the source article.
Of course YMMV, this is just one of the benchmarks.
Upvotes: 6
Reputation: 5392
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
Upvotes: 438
Reputation: 675
A list of the few remaining cosmetic and packaging differences between Oracle JDK 11 and OpenJDK 11 can be found in this blog post:
https://blogs.oracle.com/java-platform-group/oracle-jdk-releases-for-java-11-and-later
In short:
Upvotes: 11
Reputation: 471
The Oracle and OpenJDK JVMs are the same and have the same GC features (as of the latest versions 10+). Prior to Oracle managing the OpenJDK JVM there were concrete differences that made that old Openjdk JVM almost unusable in many environments. The JVMs are now the same.
The JDKs which include the JVM as part of the Kit, differ by licensing, release and maintenance schedule, and the software libraries included in the JDK. Crucial differences to me also mean things that would make code not run if not present. Not only licensing.
diff --brief -r openjdk oraclejdk
Crucially the following files are missing in addition to a bunch of others on the linux JDK (So if you 'claimed' that code didn't work on OpenJDK and did so on OracleJDK while you were using javafx then you were correct):
Only in jdk-10.0.1/bin: javapackager
Only in jdk-10.0.1/bin: javaws
Only in jdk-10.0.1/bin: jcontrol
Only in jdk-10.0.1/bin: jmc
Only in jdk-10.0.1/bin: jweblauncher
Only in jdk-10.0.1/lib: ant-javafx.jar
Only in jdk-10.0.1/lib: deploy
Only in jdk-10.0.1/lib: deploy.jar
Only in jdk-10.0.1/lib: desktop
Only in jdk-10.0.1/lib: fontconfig.bfc
Only in jdk-10.0.1/lib: fontconfig.properties.src
Only in jdk-10.0.1/lib: fontconfig.RedHat.6.bfc
Only in jdk-10.0.1/lib: fontconfig.RedHat.6.properties.src
Only in jdk-10.0.1/lib: fontconfig.SuSE.11.bfc
Only in jdk-10.0.1/lib: fontconfig.SuSE.11.properties.src
Only in jdk-10.0.1/lib: fonts
Only in jdk-10.0.1/lib: javafx.properties
Only in jdk-10.0.1/lib: javafx-swt.jar
Only in jdk-10.0.1/lib: java.jnlp.jar
Only in jdk-10.0.1/lib: javaws.jar
Only in jdk-10.0.1/lib: jdk.deploy.jar
Only in jdk-10.0.1/lib: jdk.javaws.jar
Only in jdk-10.0.1/lib: jdk.plugin.jar
Only in jdk-10.0.1/lib: jfr
Only in jdk-10.0.1/lib: libavplugin-53.so
Only in jdk-10.0.1/lib: libavplugin-54.so
Only in jdk-10.0.1/lib: libavplugin-55.so
Only in jdk-10.0.1/lib: libavplugin-56.so
Only in jdk-10.0.1/lib: libavplugin-57.so
Only in jdk-10.0.1/lib: libavplugin-ffmpeg-56.so
Only in jdk-10.0.1/lib: libavplugin-ffmpeg-57.so
Only in jdk-10.0.1/lib: libbci.so
Only in jdk-10.0.1/lib: libcmm.so
Only in jdk-10.0.1/lib: libdecora_sse.so
Only in jdk-10.0.1/lib: libdeploy.so
Only in jdk-10.0.1/lib: libfxplugins.so
Only in jdk-10.0.1/lib: libglassgtk2.so
Only in jdk-10.0.1/lib: libglassgtk3.so
Only in jdk-10.0.1/lib: libglass.so
Only in jdk-10.0.1/lib: libgstreamer-lite.so
Only in jdk-10.0.1/lib: libjavafx_font_freetype.so
Only in jdk-10.0.1/lib: libjavafx_font_pango.so
Only in jdk-10.0.1/lib: libjavafx_font.so
Only in jdk-10.0.1/lib: libjavafx_iio.so
Only in jdk-10.0.1/lib: libjfxmedia.so
Only in jdk-10.0.1/lib: libjfxwebkit.so
Only in jdk-10.0.1/lib: libnpjp2.so
Only in jdk-10.0.1/lib: libprism_common.so
Only in jdk-10.0.1/lib: libprism_es2.so
Only in jdk-10.0.1/lib: libprism_sw.so
Only in jdk-10.0.1/lib: librm.so
Only in jdk-10.0.1/lib: libt2k.so
Only in jdk-10.0.1/lib: locale
Only in jdk-10.0.1/lib: missioncontrol
Only in jdk-10.0.1/lib: oblique-fonts
Only in jdk-10.0.1/lib: plugin.jar
Only in jdk-10.0.1/lib: plugin-legacy.jar
Only in jdk-10.0.1/lib/security: blacklist
Only in jdk-10.0.1/lib/security: public_suffix_list.dat
Only in jdk-10.0.1/lib/security: trusted.libraries
Only in openjdk-10.0.1: man`
Upvotes: 37
Reputation: 12751
A key difference going forward is the release schedule and support policy.
OpenJDK will have a feature release every 6 months which is only supported until the next feature release. It's essentially a continuous stream of releases targeted to developers.
The Oracle JDK is targeted more towards an enterprise audience which values stability. It's based on one of the OpenJDK releases but is then given long term support (LTS). The Oracle JDK has releases planned every 3 years.
Upvotes: 114