Differences between Oracle JDK and OpenJDK

后端 未结 11 1244
囚心锁ツ
囚心锁ツ 2020-11-22 12:01

NOTE: This question is from 2014. As of Java 11 OpenJDK and Oracle JDK are converging.

Are there any crucial differences between Ora

相关标签:
11条回答
  • 2020-11-22 12:05

    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.

    • Rockit was the Oracle’s JVM and from Java SE 7, HotSpot and JRockit merged into a single JVM. So now we have only the merged HotSpot JVM available.
    • There are instances where people claim that they had issues while running OpenJDK and that got solved when switched over to Oracle JDK.
    • Twitter has its own JDK.
    • Software like Minecraft expects Oracle JDK to be used. In fact, warns.

    For a full list of differences please see the source article: Oracle JDK vs OpenJDK and Java JDK Development Process

    0 讨论(0)
  • 2020-11-22 12:05

    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`
    
    0 讨论(0)
  • 2020-11-22 12:05

    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.

    0 讨论(0)
  • 2020-11-22 12:06

    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

    0 讨论(0)
  • 2020-11-22 12:10

    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:

    • Oracle JDK 11 emits a warning when using the -XX:+UnlockCommercialFeatures option,
    • it can be configured to provide usage log data to the “Advanced Management Console” tool,
    • it has always required third party cryptographic providers to be signed by a known certificate,
    • it will continue to include installers, branding and JRE packaging,
    • while the javac --release command behaves slightly differently for the Java 9 and Java 10 targets, and
    • the output of the java --version and java -fullversion commands will distinguish Oracle JDK builds from OpenJDK builds.
    0 讨论(0)
  • 2020-11-22 12:12

    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?".

    0 讨论(0)
提交回复
热议问题