云网牛站
所在位置:首页 > Linux新闻 > 解析OracleJDK和OpenJDK之间的差异

解析OracleJDK和OpenJDK之间的差异

2018-12-03 21:57:41作者:文进稿源:云网牛站

下面为你解析OracleJDK和OpenJDK之间的差异,原标题为Differences between Oracle JDK and OpenJDK,下面为你带来英文及翻译版本。可以阅读Java 11提供长期支持,附介绍主流OpenJDK变种版本一文。

 

一、原文:Differences between Oracle JDK and OpenJDK

Although we have stated the goal to have OpenJDK and Oracle JDK binaries be as close to each other as possible there remains, at least for JDK 11, several differences between the two options.

The current differences are:

1、Only Oracle JDK offers Solaris, only OpenJDK offers Alpine Linux.

2、Oracle JDK offers "installers" (msi, rpm, deb, etc.) which not only place the JDK binaries in your system but also contain update rules and in some cases handle some common configurations like set common environmental variables (such as, JAVA_HOME in Windows) and establish file associations (such as, use java to launch .jar files). OpenJDK is offered only as compressed archive (tar.gz or .zip).

3、javac —release for release values 9 and 10 behave differently. Oracle JDK binaries include APIs that were not added to OpenJDK binaries like javafx, resource management, and (pre JDK 11 changes) JFR APIs.

4、Oracle JDK offers "JDK" and "JRE". OpenJDK offers only "JDK".

5、Usage Logging is only available in Oracle JDK.

6、OpenJDK will (continue to) throw an error and halt if the -XX:+UnlockCommercialFeatures flag is used. Oracle JDK no longer requires the flag and will print a warning but continue execution if used.

7、Oracle JDK requires that third party cryptographic providers be signed with an Oracle-provided certificate. OpenJDK will continue allowing the use of unsigned third party crypto providers.

8、The output of java -version will be different. Oracle JDK will say java and include LTS. OpenJDK (when produced by Oracle) will say OpenJDK and not include the Oracle-specific LTS identifier.

9、Oracle JDK will be released under OTN License. Any License file will need to point to OTN. OpenJDK will be released under GPLv2wCP and will include the GPL license.

10、Oracle JDK will distribute FreeType under the FreeType license and OpenJDK will do so under GPLv2. The contents of \legal\java.desktop\freetype.md will therefore be different.

11、Oracle JDK has Java cup and steam icons and OpenJDK has Duke icons.

12、Oracle JDK source code includes "ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms." and OpenJDK source includes the GPL.

 

二、中文翻译版:OracleJDK和OpenJDK之间的差异

虽然我们已经说过让OpenJDK和OracleJDK二进制文件尽可能彼此接近一致,但至少在JDK 11中,这两个选项之间存在一些差异。

OracleJDK和OpenJDK目前的差异是:

1、只有Oracle JDK提供Solaris,只有OpenJDK提供Alpine Linux。

2、Oracle JDK提供安装程序(msi,rpm,deb等),它们不仅将JDK二进制文件放在系统中,还包含更新规则,并且在某些情况下处理一些常见配置,例如设置公共环境变量(例如,Windows中的JAVA_HOME)并建立文件关联(例如,使用java来启动.jar文件)。OpenJDK仅作为压缩文件(tar.gz或.zip)提供。

3、javac --release 9和javac --release 10表现是不同的。Oracle JDK二进制文件包括未添加到OpenJDK二进制文件的API,如javafx,资源管理和(JDK 11之前的更改)JFR API。

4、Oracle JDK提供“JDK”和“JRE”。OpenJDK仅提供“JDK”。

5、使用日志Usage Logging仅在Oracle JDK中可用。

6、如果使用-XX:+ UnlockCommercialFeatures标志,OpenJDK将(继续)出现错误并停止。 Oracle JDK不再需要该选项,如果用了会输出警告信息,但是会继续运行。

7、Oracle JDK要求使用Oracle提供的证书对第三方加密提供程序进行签名。OpenJDK将继续允许使用未签名的第三方加密提供程序。

8、java -version的输出会有所不同。Oracle JDK会说java并包含LTS。OpenJDK(由Oracle生产)将说OpenJDK,而不包括Oracle特定的LTS标识符。

9、Oracle JDK将在OTN许可下发布。任何许可证文件都需要指向OTN。OpenJDK将在GPLv2wCP下发布,并将包含GPL许可。

10、Oracle JDK将在FreeType许可下分发FreeType,而OpenJDK将在GPLv2下分发。因此\legal\java.desktop\freetype.md的内容将有所不同。

11、Oracle JDK有Java杯和蒸汽图标,OpenJDK有Duke图标。

解析OracleJDK和OpenJDK之间的差异

12、Oracle JDK源代码包括ORACLE PROPRIETARY/CONFIDENTIAL,使用受许可条款约束。和OpenJDK源包括GPL。

 

相关主题

在RHEL/CentOS上安装OpenJDK和Oracle JDK

精选文章
热门文章