java 使用 OpenJDK 的原因是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/47236543/
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
What is the reason to use OpenJDK?
提问by Turkhan Badalov
I somehow understand the differences between Oracle JDK
and Open JDK
.
But I can't find reasons to use Open JDK
.
Because Oracle JDK
already has everything one would need and sometimes faster than Open JDK
.
我莫名其妙地理解之间的差异Oracle JDK
和Open JDK
。
但我找不到使用Open JDK
.
因为Oracle JDK
已经拥有了人们需要的一切,而且有时比Open JDK
.
In which cases should someone use Open JDK
?
Is it just for legality issues?
If yes, then what are issues?
That because I have been still develop all my projects using Oracle JDK
在哪些情况下应该有人使用Open JDK
?
仅仅是为了合法性问题吗?
如果是,那么问题是什么?
那是因为我仍然使用Oracle JDK
采纳答案by Stephen C
November 2017:At the time this question was asked, the reasons for choosing between OpenJDK and Oracle JDK include:
2017 年 11 月:在问这个问题时,选择 OpenJDK 和 Oracle JDK 的原因包括:
Availability of builds / installers for specific platforms. For example, last time I checked there were no Oracle JDK distros in ".deb" format for Debian / Ubuntu. And no OpenJDK builds for Windows.
Oracle JDK has some commercial features that can be enabled by people who have paid. They are not present on OpenJDK.
Oracle JDK has an annoying click-through license. This is a pain if you are trying to automate deployment; e.g. to cloud VMs. By contrast, OpenJDK on Linux (at least) can be installed and updated using the platform's package manager.
There may be issues if you wanted commercial support for OpenJDK.
特定平台的构建/安装程序的可用性。例如,上次我检查没有用于 Debian / Ubuntu 的“.deb”格式的 Oracle JDK 发行版。并且没有为 Windows 构建 OpenJDK。
Oracle JDK 有一些商业功能,付费的人可以启用。它们不存在于 OpenJDK 中。
Oracle JDK 有一个令人讨厌的点击许可。如果您尝试自动化部署,这会很痛苦;例如到云虚拟机。相比之下,Linux 上的 OpenJDK(至少)可以使用平台的包管理器进行安装和更新。
如果您需要对 OpenJDK 的商业支持,可能会出现问题。
There wereno substantivelicense differences between Oracle JDK and OpenJDK if you just plan to use the software. (There are some constraints on binary redistribution for Oracle JDK, but they are about shipping non-standard or stripped-down versions of the Java platform.)
有是没有实质性的Oracle JDK和OpenJDK的之间的差异许可证,如果你只打算使用该软件。(对于 Oracle JDK 的二进制重新分发存在一些限制,但它们是关于发布 Java 平台的非标准或精简版本。)
In the future, some of these differences will go away, according to this blog page:
根据此博客页面,将来,其中一些差异将消失:
Update in December 2018:
2018 年 12 月更新:
As of January 2019, Oracle JDK Java 8 will be EOL for commercial uses. (But free support will continue until January 2020 for personal use.)
Java 9 and Java 10 are EOL.
Commercial uses of Oracle JDK Java 11 and later require a support contract or a subscription from Oracle. OpenJDK Java builds do not have this requirement.
Oracle do not provide support for OpenJDK Java builds, but support is available from 3rd parties. Third parties will also port Oracle security fixes to OpenJDK builds.
自 2019 年 1 月起,Oracle JDK Java 8 将停止用于商业用途。(但免费支持将持续到 2020 年 1 月供个人使用。)
Java 9 和 Java 10 已停产。
Oracle JDK Java 11 及更高版本的商业用途需要来自 Oracle 的支持合同或订阅。OpenJDK Java 构建没有这个要求。
Oracle 不提供对 OpenJDK Java 构建的支持,但可以从 3rd 方获得支持。第三方还将将 Oracle 安全修复程序移植到 OpenJDK 构建中。
Further reading:
进一步阅读:
回答by Basil Bourque
Other Answers are correct. Here is some other information as well, including vital changes as of late 2019.
其他答案都是正确的。这里还有一些其他信息,包括截至 2019 年底的重要变化。
Source-code versus Binaries/installers
源代码与二进制文件/安装程序
understand the differences between Oracle JDK and Open JDK.
了解 Oracle JDK 和 Open JDK 之间的区别。
To sum it up: source-codeversus binaries/installers.
总结一下:源代码与二进制文件/安装程序。
- OpenJDKis an open-source project, implementing the Java Specifications, JSRs, and JEPsthat define the Java platform. This project publishes only source-code, not binaries or installers to get Java running on your computer. Oracle is the principal participant in the OpenJDK project, alongside IBM & Red Hat, Apple, SAP, Azul Systems, and others.
- Many companies provide distributions of OpenJDK for installation, as binaries or installers. Oracle is one such company.
- OpenJDK是一个开源项目,实现了定义Java 平台的Java 规范、JSR和JEP。该项目仅发布源代码,而不发布二进制文件或安装程序,以使 Java 在您的计算机上运行。Oracle 是 OpenJDK 项目的主要参与者,此外还有 IBM 和 Red Hat、Apple、SAP、Azul Systems 等。
- 许多公司以二进制文件或安装程序的形式提供用于安装的 OpenJDK 发行版。甲骨文就是这样一家公司。
Oracle actually provides two such products:
Oracle 实际上提供了两种这样的产品:
- Oracle JDK
A commercial product, with paid support plans. (Free-of-cost only for development & testing, not deployment. Read their terms.) - jdk.java.net
A build of the OpenJDK source-code, freely available, unsupported.
- Oracle JDK
具有付费支持计划的商业产品。(免费仅用于开发和测试,不适用于部署。阅读他们的条款。) - jdk.java.net
OpenJDK 源代码的构建,免费提供,不受支持。
Oracle has declared their intention to keep their commercial product Oracle JDKat feature-parity with OpenJDK. Oracle even went so far as to open-source and make available at no cost their formerly commercial tools Mission Controland Flight Recorder, both now a part of OpenJDK. So there is nearly no practical difference. One significant difference is that the Oracle company reserves the right to rapidly supply their paid support customer base with urgent patches not currently found in OpenJDK. Ditto for other vendors selling support.
Oracle 已经宣布他们打算让他们的商业产品Oracle JDK与 OpenJDK 的功能相同。Oracle 甚至开源并免费提供他们以前的商业工具Mission Control和Flight Recorder,它们现在都是OpenJDK的一部分。所以几乎没有实际区别。一个显着的区别是 Oracle 公司保留向其付费支持客户群快速提供 OpenJDK 当前未找到的紧急补丁的权利。其他销售支持的供应商也是如此。
[And for the record, Oracle offers a third implementation of Java, GraalVM, which is a very specialized product.]
[作为记录,Oracle 提供了 Java 的第三种实现GraalVM,这是一个非常专业的产品。]
Here is a flowchart graphic I made to help guide you in selecting a provider of a Java implementation.
这是我制作的流程图,以帮助指导您选择 Java 实现的提供者。
And here is a list of motivations you might consider in choosing a distribution.
这是您在选择发行版时可能会考虑的动机列表。
回答by Florian Weimer
OpenJDK comes tightly integrated with the distribution update process. For example, on Fedora, this means that you simply can run
OpenJDK 与分发更新过程紧密集成。例如,在 Fedora 上,这意味着您只需运行
dnf update
without activating third-party repositories, and you will get the latest OpenJDK version with all relevant fixes.
无需激活第三方存储库,您将获得包含所有相关修复程序的最新 OpenJDK 版本。
OpenJDK is tested by the distribution vendor on this particular distribution. Oracle has different reference platforms for testing of OpenJDK. In the case of Fedora, software written in Java is tested with the OpenJDK version provided by the distribution, while the combination of that software with Oracle JDK receives much less testing.
OpenJDK 由分发供应商在此特定分发上进行测试。Oracle 有不同的参考平台来测试 OpenJDK。在 Fedora 的情况下,用 Java 编写的软件使用发行版提供的 OpenJDK 版本进行测试,而该软件与 Oracle JDK 的组合接受的测试要少得多。
Oracle also bundles their Java downloads with additional software such as browser toolbars, performance measurement and monitoring tools.
Oracle 还将他们的 Java 下载与其他软件捆绑在一起,例如浏览器工具栏、性能测量和监控工具。
回答by madhead
For those, who read this in 2019.
对于那些在 2019 年读过这篇文章的人。
Java SE 8 is the last Java SE release targeting Desktop deployment (eg, Java Web Start and a stand-alone system JRE). Java SE 8 will be end of public updates in January 2019, after which commercial users need to either transition to other technologies, or purchase a Java SE Subscription.
Java SE 8 是最后一个面向桌面部署(例如,Java Web Start 和独立系统 JRE)的 Java SE 版本。Java SE 8 将于 2019 年 1 月结束公开更新,之后商业用户需要过渡到其他技术,或购买Java SE 订阅。
So, another reason to use OpenJDK (in addition to what Stephen Csaid): it's free of charge for all purposes.