Java Oracle JDK 和 OpenJDK 之间的差异
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22358071/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Differences between Oracle JDK and OpenJDK
提问by user1340582
NOTE: This question is from 2014. As of Java 11 OpenJDK and Oracle JDK are converging.
注意:这个问题来自 2014 年。从 Java 11 开始,OpenJDK 和 Oracle JDK 正在融合。
Are there any crucial differences between Oracle and OpenJDK?
Oracle 和 OpenJDK 之间有什么重要区别吗?
For example, are the garbage collection and other JVM parameters the same?
例如,垃圾收集和其他JVM参数是否相同?
Does GC work differently between the two?
GC 在两者之间的工作方式是否不同?
采纳答案by Venkateswara Rao
Both OpenJDK and Oracle JDK are created and maintained currently by Oracle only.
OpenJDK 和 Oracle JDK 目前仅由 Oracle 创建和维护。
OpenJDK and Oracle JDK are implementations of the same Java specification passed the TCK (Java Technology Certification Kit).
OpenJDK 和 Oracle JDK 是通过 TCK(Java 技术认证工具包)的相同 Java 规范的实现。
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.
大多数 JDK 供应商都是在 OpenJDK 之上编写的,通过对[主要是替换许可的专有部件/替换为仅适用于特定操作系统的高性能项目]组件进行一些调整,而不破坏 TCK 兼容性。
Many vendors implemented the Java specification and got TCK passed. For example, IBM J9, Azul Zulu, Azul Zing, and Oracle JDK.
许多供应商实施了 Java 规范并通过了 TCK。例如,IBM J9、Azul Zulu、Azul Zing 和 Oracle JDK。
Almost every existing JDK is derived from OpenJDK.
几乎所有现有的 JDK 都源自 OpenJDK。
As suggested by many, licensing is a change between JDKs.
正如许多人所建议的那样,许可是 JDK 之间的变化。
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
从 JDK 11 开始访问长期支持 Oracle JDK/Java SE 现在将需要商业许可证。您现在应该注意您正在安装的 JDK,因为没有订阅的 Oracle JDK 可能会停止工作。来源
Ref: List of Java virtual machines
参考:Java 虚拟机列表
回答by radai
For Java 7, nothing crucial. The OpenJDK project is mostly based on HotSpotsource code donated by Sun.
对于Java 7,没有什么重要的。OpenJDK 项目主要基于Sun 捐赠的HotSpot源代码。
Moreover, OpenJDK was selected to be the reference implementation for Java 7and is maintained by Oracle engineers.
此外,OpenJDK 被选为Java 7的参考实现,并由 Oracle 工程师维护。
There's a more detailed answer from 2012 on difference between JVM, JDK, JRE & OpenJDK, which links to an Oracle blog post:
从 2012 年开始,有一个关于JVM、JDK、JRE 和 OpenJDK 之间差异的更详细的答案,该答案链接到Oracle 博客文章:
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.
问:在 OpenJDK 存储库中找到的源代码与您用于构建 Oracle JDK 的代码有什么区别?
答:非常接近 - 我们的 Oracle JDK 版本构建过程建立在 OpenJDK 7 之上,只添加了几部分,例如部署代码,其中包括 Oracle 对 Java 插件和 Java WebStart 的实现,以及一些封闭源代码的第三部分方组件,如图形光栅化器,一些开源第三方组件,如 Rhino,以及一些零碎的东西,如附加文档或第三方字体。展望未来,我们的目的是开源 Oracle JDK 的所有部分,除了我们考虑的商业功能(例如 JRockit Mission Control(Oracle JDK 尚未提供)),并用开源替代品替换受阻碍的第三方组件以实现更接近的平等代码库之间。
回答by 45hook
For Java 8, Oracle JDK vs. OpenJDK my take of key differences:
对于Java 8,Oracle JDK 与 OpenJDK 的主要区别:
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 Rhinorespectively. 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.
OpenJDK 是 Java 标准版平台的开源实现,由 Oracle 和开放 Java 社区贡献。
OpenJDK 是在 GPL v2 许可下发布的,其中 Oracle JDK 根据 Oracle 二进制代码许可协议获得许可。
实际上,Oracle JDK 的构建过程是从 OpenJDK 源代码构建的。所以 Oracle JDK 和 OpenJDK 之间没有重大的技术差异。除了基本代码,Oracle JDK 还包括Oracle 的Java Plugin 和Java WebStart 实现。它还分别包含第三方闭源和开源组件,如图形光栅化器和Rhino。OpenJDK Font Renderer 和 Oracle JDK Flight Recorder 是 Oracle JDK 和 OpenJDK 之间显着的主要区别。
- Rockit 是 Oracle 的 JVM,从 Java SE 7 开始,HotSpot 和 JRockit 合并为一个 JVM。所以现在我们只有合并的 HotSpot JVM 可用。
- 在某些情况下,人们声称他们在运行 OpenJDK 时遇到了问题,但在切换到 Oracle JDK 后问题得到了解决。
- Twitter 有自己的 JDK。
- 像 Minecraft 这样的软件需要使用 Oracle JDK。事实上,警告。
For a full list of differences please see the source article: Oracle JDK vs OpenJDK and Java JDK Development Process
有关差异的完整列表,请参阅源文章:Oracle JDK vs OpenJDK 和 Java JDK 开发过程
回答by The Gilbert Arenas Dagger
A key difference going forward is the release schedule and support policy.
未来的一个主要区别是发布时间表和支持政策。
OpenJDK
开放式JDK
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.
OpenJDK 将每 6 个月发布一次功能发布,仅在下一个功能发布之前受支持。它本质上是针对开发人员的连续发布流。
Oracle JDK
甲骨文JDK
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.
Oracle JDK 更面向重视稳定性的企业受众。它基于 OpenJDK 版本之一,但随后获得了长期支持 (LTS)。Oracle JDK 计划每 3 年发布一次。
来源:https: //www.oracle.com/java/java9-screencasts.html?bcid=5582439790001&playerType=single-social&size=events
回答by mars
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.
Oracle 和 OpenJDK JVM 是相同的,并且具有相同的 GC 特性(截至最新版本 10+)。在 Oracle 管理 OpenJDK JVM 之前,存在一些具体差异,使旧的 Openjdk JVM 在许多环境中几乎无法使用。JVM 现在是相同的。
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.
包含 JVM 作为套件一部分的 JDK 在许可、发布和维护计划以及 JDK 中包含的软件库方面有所不同。对我来说,关键的差异也意味着如果不存在代码就会无法运行。不仅许可。
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):
至关重要的是,除了 linux JDK 上的一堆其他文件之外,还缺少以下文件(因此,如果您“声称”该代码在 OpenJDK 上不起作用,而在使用 javafx 时却在 OracleJDK 上起作用,那么您是正确的):
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`
回答by Dalibor Topic
A list of the few remaining cosmetic and packaging differences between Oracle JDK 11 and OpenJDK 11 can be found in this blog post:
在这篇博文中可以找到 Oracle JDK 11 和 OpenJDK 11 之间少数剩余的外观和包装差异的列表:
https://blogs.oracle.com/java-platform-group/oracle-jdk-releases-for-java-11-and-later
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.
- Oracle JDK 11 在使用 -XX:+UnlockCommercialFeatures 选项时发出警告,
- 它可以配置为向“高级管理控制台”工具提供使用日志数据,
- 它一直要求第三方加密提供商由已知证书签名,
- 它将继续包括安装程序、品牌和 JRE 包装,
- 而 javac --release 命令对于 Java 9 和 Java 10 目标的行为略有不同,并且
- java --version 和 java -fullversion 命令的输出将区分 Oracle JDK 构建和 OpenJDK 构建。
回答by Naresh Joshi
According to the oracle blog, Oracle JDK Releases for Java 11 and Later
根据 oracle 博客,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.
从 Java 11 开始,Oracle 将根据开源GNU 通用公共许可证 v2、Classpath Exception (GPLv2+CPE)和商业许可证提供 JDK 版本,供使用 Oracle JDK 作为 Oracle 产品或服务的一部分的人使用,或者谁不想使用开源软件。这种使用开源许可证和商业许可证的组合取代了历史悠久的“ BCL”许可证,后者具有免费和付费商业条款的组合。
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
从 BCL 到 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 buildsas 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.
十多年来,Oracle Java SE 技术的二进制代码许可 (“BCL”)一直是 Oracle Java SE 技术的主要许可。BCL 允许在某些条件下使用而无需支付许可费。为了简化未来的工作,Oracle 开始提供开源许可的 OpenJDK 构建,从 Java 9 开始,使用与 Linux 平台相同的许可模型。如果您习惯于免费获得 Oracle Java SE 二进制文件,您可以简单地继续使用jdk.java.net 上提供的 Oracle OpenJDK 构建。如果您习惯于将 Oracle Java SE 二进制文件作为 Oracle 商业产品或服务的一部分,那么您可以继续通过My Oracle Support(MOS) 和其他位置获取 Oracle JDK 版本。
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:
Oracle 的 BCL 许可 JDK 历来包含 OpenJDK 版本中不可用的“商业功能”。然而,正如承诺的那样,在过去的一年里,Oracle 向 OpenJDK 社区贡献了这些特性,包括:
From Java 11 forward, therefore, Oracle JDK builds and OpenJDK buildswill be essentially identical.
因此,从 Java 11 开始,Oracle JDK 构建和OpenJDK 构建将基本相同。
...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.
确实存在少量差异,有些是有意的和表面上的,有些仅仅是因为需要更多时间与 OpenJDK 贡献者进行讨论。
- Oracle JDK 11 emits a warning when using the -XX:+UnlockCommercialFeatures option, whereas in OpenJDK builds this option results in an error. This option was never part of OpenJDK and it would not make sense to add it now, since there are no commercial features in OpenJDK. This difference remains in order to make it easier for users of Oracle JDK 10 and earlier releases to migrate to Oracle JDK 11 and later.
- Oracle JDK 11 can be configured to provide usage log data to the “Advanced Management Console” tool, which is a separate commercial Oracle product. We will work with other OpenJDK contributors to discuss how such usage data may be useful in OpenJDK in future releases, if at all. This difference remains primarily to provide a consistent experience to Oracle customers until such decisions are made.
- The javac --release command behaves differently for the Java 9 and Java 10 targets, since in those releases the Oracle JDK contained some additional modules that were not part of corresponding OpenJDK releases:
- javafx.base
- javafx.controls
- javafx.fxml
- javafx.graphics
- javafx.media
- javafx.web
- java.jnlp
- jdk.jfr
- jdk.management.cmm
- jdk.management.jfr
- jdk.management.resource
- jdk.packager.services
- jdk.snmp
- Oracle JDK 11 在使用 -XX:+UnlockCommercialFeatures 选项时发出警告,而在 OpenJDK 构建中,此选项会导致错误。这个选项从来不是 OpenJDK 的一部分,现在添加它也没有意义,因为 OpenJDK 中没有商业特性。保留此差异是为了使 Oracle JDK 10 及更早版本的用户更容易迁移到 Oracle JDK 11 及更高版本。
- Oracle JDK 11 可以配置为向“高级管理控制台”工具提供使用日志数据,该工具是一个单独的商业 Oracle 产品。我们将与其他 OpenJDK 贡献者合作,讨论此类使用数据如何在未来版本的 OpenJDK 中使用(如果有的话)。这种差异主要是为了在做出此类决定之前为 Oracle 客户提供一致的体验。
- javac --release 命令对于 Java 9 和 Java 10 目标的行为不同,因为在这些版本中,Oracle JDK 包含一些不属于相应 OpenJDK 版本的附加模块:
- javafx.base
- javafx.controls
- 文件
- 图形文件
- 媒体文件
- 网页版
- java.jnlp
- jdk文件
- jdk.management.cmm
- jdk.management.jfr
- jdk.management.resource
- jdk.packager.services
- jdk文件
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).
这种差异仍然存在,以便为特定类型的传统使用提供一致的体验。这些模块现在作为OpenJFX 的一部分单独提供,现在同时包含在 OpenJDK 和 Oracle JDK 中,因为它们是 Oracle 为 OpenJDK 贡献的商业功能(例如,Flight Recorder),或者已从 Oracle JDK 11(例如,JNLP)中删除.
- The output of the java --version and java -fullversion commands will distinguish Oracle JDK builds from OpenJDK builds, so that support teams can diagnose any issues that may exist. Specifically, running java --version with an Oracle JDK 11 build results in:
- java --version 和 java -fullversion 命令的输出将区分 Oracle JDK 构建和 OpenJDK 构建,以便支持团队可以诊断可能存在的任何问题。具体来说,使用 Oracle JDK 11 构建运行 java --version 会导致:
java 11 2018-09-25
爪哇 11 2018-09-25
Java(TM) SE Runtime Environment 18.9 (build 11+28)
Java(TM) SE 运行时环境 18.9(构建 11+28)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11+28, mixed mode)
Java HotSpot(TM) 64 位服务器 VM 18.9(构建 11+28,混合模式)
And for an OpenJDK 11 build:
对于 OpenJDK 11 构建:
openjdk version "11" 2018-09-25
openjdk 版本“11” 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 运行时环境 18.9(构建 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
OpenJDK 64 位服务器 VM 18.9(构建 11+28,混合模式)
- The Oracle JDK has always required third party cryptographic providers to be signed by a known certificate. The cryptography framework in OpenJDK has an open cryptographic interface, meaning it does not restrict which providers can be used. Oracle JDK 11 will continue to requirea valid signature, and Oracle OpenJDK builds will continue to allow the use of either a valid signature or unsigned third party crypto provider.
- Oracle JDK 11 will continue to include installers, branding and JRE packaging for an experience consistent with legacy desktop uses. Oracle OpenJDK builds are currently available as zip and tar.gz files, while alternative distribution formats are being considered.
- Oracle JDK 一直要求第三方加密提供程序由已知证书签名。OpenJDK 中的加密框架具有开放的加密接口,这意味着它不限制可以使用哪些提供程序。Oracle JDK 11 将继续需要有效签名,并且 Oracle OpenJDK 版本将继续允许使用有效签名或未签名的第三方加密提供程序。
- Oracle JDK 11 将继续包括安装程序、品牌和 JRE 打包,以获得与传统桌面使用一致的体验。Oracle OpenJDK 版本目前以 zip 和 tar.gz 文件的形式提供,同时正在考虑其他分发格式。
回答by Greg Dubicki
Also for Java 8an 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 2018showing that, among other differences:
此外,对于Java 8 ,AMIS 技术博客在各种 JVM 上托管的反应式(非阻塞)Spring Boot REST 应用程序的有趣性能基准测试已于 2018 年 11 月发布,表明除其他差异外:
- OpenJDK has higher CPU usage than OracleJDK,
- OpenJDK has slightly lower response time than OracleJDK,
- OpenJDK has higher memory usage than OracleJDK,
- OpenJDK 的 CPU 使用率高于 OracleJDK,
- OpenJDK 的响应时间比 OracleJDK 略低,
- OpenJDK 的内存使用率高于 OracleJDK,
For details please see the source article.
有关详细信息,请参阅源文章。
Of course YMMV, this is just one of the benchmarks.
当然 YMMV,这只是基准之一。
回答by Gili
Aside from the obvious licensing difference, the major difference between OpenJDK and OracleJDK 11 are stability and performance updates.
除了明显的许可差异外,OpenJDK 和 OracleJDK 11 之间的主要区别在于稳定性和性能更新。
Source: https://www.youtube.com/watch?v=Adv9--6IcQI&t=385
来源: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.
每 6 个月,这两个代码库将保持同步。但是在 6 个月的窗口中,OpenJDK 将只收到安全更新,而 OracleJDK 将收到额外的稳定性和性能更新。
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.
鉴于 OpenJDK 和 OracleJDK 的更新版本仅每 3 个月发布一次,这意味着您将错过(最多)3 个月的修复,直到下一个主要版本发布并升级。但是,如果您选择坚持 LTS 版本,那么商业许可证开始变得更有意义。
回答by Istiaque Hossain
- Oracle will deliver releases every three years, while OpenJDK will be released every six months.
- Oracle provides long term support for its releases. On the other hand, OpenJDK supports the changes to a release only until the next version is released.
- Oracle JDK was licensed under Oracle Binary Code License Agreement, whereas OpenJDK has the GNU General Public License (GNU GPL) version 2 with a linking exception.
- Oracle product has Flight Recorder, Java Mission Control, and Application Class-Data Sharing features, while OpenJDK has the Font Renderer feature.Also, Oracle has more Garbage Collection options and better renderers,
- Oracle JDK is fully developed by Oracle Corporation whereas the OpenJDK is developed by Oracle, OpenJDK, and the Java Community. However, the top-notch companies like Red Hat, Azul Systems, IBM, Apple Inc., SAP AG also take an active part in its development.
- Oracle 每三年发布一次,而 OpenJDK 每六个月发布一次。
- Oracle 为其版本提供长期支持。另一方面,OpenJDK 仅在下一个版本发布之前支持对版本的更改。
- Oracle JDK 根据 Oracle 二进制代码许可协议获得许可,而 OpenJDK 具有 GNU 通用公共许可证 (GNU GPL) 版本 2,但有一个链接例外。
- Oracle 产品具有 Flight Recorder、Java Mission Control 和 Application Class-Data Sharing 特性,而 OpenJDK 具有 Font Renderer 特性。此外,Oracle 具有更多垃圾收集选项和更好的渲染器,
- Oracle JDK 完全由 Oracle Corporation 开发,而 OpenJDK 由 Oracle、OpenJDK 和 Java 社区开发。但是,Red Hat、Azul Systems、IBM、Apple Inc.、SAP AG 等一流公司也积极参与其发展。
From Java 11 turn to a big change
从 Java 11 转向大变革
Oracle will change its historical “BCL” license with a combination of an open source and commercial license
Oracle 将通过开源和商业许可的组合改变其历史上的“BCL”许可
- Oracle's kit for Java 11 emits a warning when using the -XX:+UnlockCommercialFeatures option, whereas in OpenJDK builds, this option results in an error
- Oracle JDK offers a configuration to provide usage log data to the “Advanced Management Console” tool
- Oracle has always required third party cryptographic providers to be signed by a known certificate, while cryptography framework in OpenJDK has an open cryptographic interface, which means there is no restriction as to which providers can be used
- Oracle JDK 11 will continue to include installers, branding, and JRE packaging, whereas OpenJDK builds are currently available as zip and tar.gz files
- The javac –release command behaves differently for the Java 9 and Java 10 targets due to the presence of some additional modules in Oracle's release
- The output of the java –version and java -fullversion commands will distinguish Oracle's builds from OpenJDK builds
- Oracle 的 Java 11 工具包在使用 -XX:+UnlockCommercialFeatures 选项时发出警告,而在 OpenJDK 构建中,此选项会导致错误
- Oracle JDK 提供了一个配置来向“高级管理控制台”工具提供使用日志数据
- Oracle 一直要求第三方加密提供程序由已知证书签名,而 OpenJDK 中的加密框架具有开放的加密接口,这意味着可以使用哪些提供程序没有限制
- Oracle JDK 11 将继续包含安装程序、品牌和 JRE 打包,而 OpenJDK 构建目前以 zip 和 tar.gz 文件形式提供
- javac –release 命令对于 Java 9 和 Java 10 目标的行为不同,因为 Oracle 的版本中存在一些附加模块
- java –version 和 java -fullversion 命令的输出将区分 Oracle 的构建和 OpenJDK 的构建
Update : 25-Aug-2019
更新:2019 年 8 月 25 日
for more details oracle-vs-openjdk
有关更多详细信息oracle-vs-openjdk