由于没有更多的 JRE 11 可供下载,如何让 Java 11 运行时环境正常工作?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/53111921/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 00:42:56  来源:igfitidea点击:

How to get Java 11 run-time environment working since there is no more JRE 11 for download?

javajava-11

提问by user3848207

Java 11 does not come with a JRE for download, unlike past Java versions. I got an error "no java run-time environment" when running some Java-based software. To fix the problem, I had to install Java 8 JRE.

与过去的 Java 版本不同,Java 11 没有提供 JRE 供下载。运行某些基于 Java 的软件时,出现错误“无 Java 运行时环境”。为了解决这个问题,我必须安装 Java 8 JRE。

How can I get my PC to run Java 11 JRE given that there is no more JRE 11 to download?

鉴于没有更多的 JRE 11 可供下载,如何让我的 PC 运行 Java 11 JRE?

I am using Windows 10.

我正在使用 Windows 10。

采纳答案by Stephen C

Right now, there seem to be no free + easy Oracle-supported Java 11 JRE (only) options. Your options are:

现在,似乎没有免费且简单的 Oracle 支持的 Java 11 JRE(仅)选项。您的选择是:

  1. Download and use an OpenJDK Java 11 JDK from the OpenJDK site.
  2. Download and use an Oracle Java 11 JDK from the Oracle site ... and be sure that you fully understand the restrictions on "commercial use" that now apply to the Oracle Java 11+ releases.
  3. Try to roll your own Windows JRE for Windows from the OpenJDK sources; see Create jre from OpenJDK Windows.
  4. Look into using the new jlinktool to create a custom image (basically a cut-down JRE) for your application. This seems to be the option that Oracle want 3rd-party application developers to use.
  5. Talk to Oracle sales about a Java support contract, and specifically ask about how to get a JRE build. (I don't know what the answer will be. If someone does try this, and they get a positive response, please comment!)
  6. Use a 3rd-party Java JRE distribution. (The list of vendors changes over time, but as of now it includes AdoptOpenJDK, Amazon, Azul, BellSoft, IBM, jClarity, Red Hat and SAP. Some of them offer a JRE.)
  1. 从 OpenJDK 站点下载并使用 OpenJDK Java 11 JDK。
  2. 从 Oracle 站点下载并使用 Oracle Java 11 JDK ...并确保您完全了解现在适用于 Oracle Java 11+ 版本的“商业用途”限制。
  3. 尝试从 OpenJDK 源为 Windows 推出您自己的 Windows JRE;请参阅从 OpenJDK Windows 创建 jre
  4. 考虑使用新的jlink工具为您的应用程序创建自定义映像(基本上是缩减的 JRE)。这似乎是 Oracle 希望 3rd 方应用程序开发人员使用的选项。
  5. 与 Oracle 销售人员讨论 Java 支持合同,并特别询问如何获得 JRE 构建。(我不知道答案会是什么。如果有人确实尝试过,并且得到了积极的回应,请发表评论!
  6. 使用第 3 方 Java JRE 发行版。(供应商列表随着时间的推移而变化,但截至目前,它包括 AdoptOpenJDK、Amazon、Azul、BellSoft、IBM、jClarity、Red Hat 和 SAP。其中一些提供 JRE。)

(Or switch from Windows to Linux. I can install an OpenJDK Java 11 JRE package from the distro package manager on the latest versions of Ubuntu, Fedora, ...)

(或者从 Windows 切换到 Linux。我可以从最新版本的 Ubuntu、Fedora 上的发行版包管理器安装 OpenJDK Java 11 JRE 包……)



For those people who think that Oracle Java 11 and OpenJDK Java 11 are the same, please read the following from the Oracle download site:

对于那些认为 Oracle Java 11 和 OpenJDK Java 11 相同的人,请从 Oracle 下载站点阅读以下内容:

Important changes in Oracle JDK 11 License

With JDK 11 Oracle has updated the license terms on which we offer the Oracle JDK. The new Oracle Technology Network License Agreement for Oracle Java SEis substantially different from the licenses under which previous versions of the JDK were offered. Please review the new terms carefully before downloading and using this product.

Oracle also offers this software under the GPL Licenseon jdk.java.net/11

Oracle JDK 11 许可证的重要变化

在 JDK 11 中,Oracle 更新了我们提供 Oracle JDK 的许可条款。针对 Oracle Java SE的新Oracle 技术网许可协议与提供 JDK 以前版本所依据的许可有很大不同。请在下载和使用本产品前仔细阅读新条款。

Oracle 还在jdk.java.net/11 上的GPL 许可下提供此软件

Notice that Oracleare saying that the licenses for Oracle Java and OpenJDK Java are different. (Not withstanding that the two are built from essentially the same source code base.) Ignore this at your peril!

请注意,Oracle表示 Oracle Java 和 OpenJDK Java 的许可证不同。(尽管这两者是从本质上相同的源代码库构建的。)忽略这一点后果自负!

回答by matson kepson

You can use the "adoptopenjdk" project website to download latest jre and JDK https://github.com/AdoptOpenJDK/openjdk-jdk11

可以使用“adoptopenjdk”项目网站下载最新的jre和JDK https://github.com/AdoptOpenJDK/openjdk-jdk11

find latest link here > https://adoptopenjdk.net/releases.html?variant=openjdk11&jvmVariant=hotspot

在此处找到最新链接 > https://adoptopenjdk.net/releases.html?variant=openjdk11&jvmVariant=hotspot

Edit: Problem has been fixed

编辑:问题已修复

I have used their night builds to workaround the problem of missing JRE in JDK package https://adoptopenjdk.net/nightly.html?variant=openjdk11

我已经使用他们的夜间构建来解决 JDK 包中缺少 JRE 的问题 https://adoptopenjdk.net/nightly.html?variant=openjdk11

回答by Basil Bourque

The Answer by Stephen Cis correct, and important.

Stephen C答案是正确且重要的。

Oracle no longer intends for end-users to be installing a JRE or a JDK. Java Appletsin a browser and Java Web Startapp delivery are both being phased out, leaving the end-user with no need for a JRE. Java-based apps are expected to bundle their own Java implementation. The only folks consciously installing a JDK will be developers & server-side sysadmins.

Oracle 不再打算让最终用户安装 JRE 或 JDK。浏览器中的Java AppletJava Web Start应用程序交付都将被逐步淘汰,最终用户无需 JRE。基于 Java 的应用程序应该捆绑自己的 Java 实现。唯一有意识地安装 JDK 的人将是开发人员和服务器端系统管理员。

Important:

重要的:

Learn about:

学习关于:

Desktop apps are now expected to bundle their own Java runtime. Those tools listed above can create a very small runtime custom-fit to your particular app.

现在预计桌面应用程序会捆绑自己的 Java 运行时。上面列出的那些工具可以为您的特定应用程序创建一个非常小的运行时定制。

Here is a flowchart diagram that may help you finding and deciding amongst the various vendors providing a Java 11 implementation.

这是一个流程图,可以帮助您在提供 Java 11 实现的各种供应商中查找和决定。

Flowchart guiding you in choosing a vendor for a Java 11 implementation.png

指导您为 Java 11 实现选择供应商的流程图.png



And a table mapping possible motivations or considerations leading to suggested vendors of Java.

以及一个表,映射可能的动机或考虑导致建议的 Java 供应商。

Motivations in choosing a vendor for Java

选择 Java 供应商的动机

Compatibility concerns

兼容性问题

In the Comments, an question was raised, concern over compatibility issues between releases by various vendors.

在评论中,提出了一个问题,关注不同供应商的版本之间的兼容性问题。

Firstly, know that the OpenJDK project includes a vast suite of tests known as the OpenJDK Community Technology Compatibility Kit (TCK). Vendors are free to self-declare whether their release has passed those tests. These claims are not verified, and rely on the honor system. On my diagram above, I have check-marked "TCK" on the couple vendors I know have self-declared: Oracle JDK by Oracle & Zulu by Azul Systems.

首先,要知道 OpenJDK 项目包含大量称为OpenJDK 社区技术兼容性工具包 (TCK) 的测试。供应商可以自行声明他们的版本是否通过了这些测试。这些说法都没有经过验证,并且依赖于荣誉系统。在我上面的图表中,我在我认识的几家自我声明的供应商上勾选了“TCK”:Oracle JDK by Oracle & Zulu by Azul Systems。

All the products listed in the blue barrel area of my chart above are built almost directly on the OpenJDK source code. So generally, you should see virtually identical compatibility.

上图中蓝桶区域列出的所有产品几乎都是直接基于 OpenJDK 源代码构建的。所以一般来说,你应该看到几乎相同的兼容性。

There are two areas of concern you might consider: Technology differences, and schedule of updates/patches.

您可能需要考虑两个方面的问题:技术差异和更新/补丁计划。

As for technology differences, vendors using the OpenJDK project can ship with either the HotSpot engineor the OpenJ9 engine. These will differ on performance (faster/slower startup versus overall speed, more/less memory), but their behavior in terms of complying with the Java specifications should be identical. They coulddiffer, and certainly either might present a flaw (that likely would be soon fixed) that the other lacked. Personally, I would not be concerned by this, but I mention it for completeness.

至于技术差异,使用 OpenJDK 项目的供应商可以随附HotSpot 引擎OpenJ9 引擎。这些将在性能上有所不同(启动更快/更慢与整体速度、更多/更少内存),但它们在遵守 Java 规范方面的行为应该是相同的。它们可能有所不同,当然,其中任何一个都可能存在另一个缺少的缺陷(可能很快就会修复)。就我个人而言,我不会担心这一点,但我提到它是为了完整性。

Another technology difference is the different kind of JVM used by Zing by Azul Systems and GraalVM by Oracle. Either of these mightdiffer in some way from each other or from the other products, because they intentionally have a different kind of JVM implementation, to offer special features. But given the thoroughness of the Java specs, they should not be incompatible. If they were, you can expect any compatibility problem to be rapidly resolved. If I needed the special features of either of these products, I would use them with full confidence.

另一个技术差异是 Azul Systems 的 Zing 和 Oracle 的 GraalVM 使用的不同类型的 JVM。它们中的任何一个都可能在某些方面彼此不同或与其他产品不同,因为它们有意具有不同类型的 JVM 实现,以提供特殊功能。但是考虑到Java 规范的完整性,它们不应该是不兼容的。如果是这样,您可以期待任何兼容性问题都会得到快速解决。如果我需要这些产品中的任何一个的特殊功能,我会充满信心地使用它们。

Another possible concern is the speed with which a vendor might update their own releases with certain bug fixes or security patches. For example, Oracle has stated that they reserve the right to immediately ship any ready patches to their own customers, while submitting those to the OpenJDK project for consideration. Certainly, any of the vendors providing commercial support are likely to rush a fix or patch to their paying customers. Those releases built as a courtesy to the community provided free-of-cost may take longer to update, likely after the OpenJDK project has incorporated a fix/patch.

另一个可能的问题是供应商可能会以某些错误修复或安全补丁更新他们自己的版本的速度。例如,Oracle 已经声明他们保留立即将任何准备好的补丁发送给他们自己的客户的权利,同时将这些补丁提交给 OpenJDK 项目以供考虑。当然,任何提供商业支持的供应商都可能急于向他们的付费客户提供修复或补丁。那些为社区提供免费提供的版本可能需要更长的时间来更新,可能是在 OpenJDK 项目合并了修复程序/补丁之后。

And each vendor is free to modify their code base at will, as long as they comply with the Java specs. For example, the Corretto team at Amazon has already made improvements to their own release, and then shared those changes upstream to the OpenJDK project. There may a gap in time before OpenJDK incorporated those changes, if they decide to do so. So it is possible that various releases might differ. But at this point, all of the vendors in the Java community seem to have sincere commitments to work together to prevent fragmentation. So, again, I have no real concern here, but mention this for completeness.

每个供应商都可以随意修改他们的代码库,只要他们遵守Java 规范。例如,亚马逊的 Corretto 团队已经对他们自己的版本进行了改进,然后将这些更改共享到 OpenJDK 项目的上游。如果他们决定这样做,在 OpenJDK 合并这些更改之前可能会有一个时间间隔。因此,各种版本可能会有所不同。但在这一点上,Java 社区中的所有供应商似乎都真诚地承诺要共同努力防止碎片化。所以,再一次,我在这里没有真正的担忧,但为了完整起见,请提及这一点。