简体   繁体   English

为什么 Eclipse 2018-12 在 JDK-11 中显示“未找到 JRE”?

[英]Why Eclipse 2018-12 says "No JREs found" in JDK-11?

In Eclipse 2018-12, when the JDK 11 root directory is selected using the search button at Windows -->Preferences--Java--Installed JREs, Eclipse says "No JREs found".在 Eclipse 2018-12 中,当使用 Windows -->Preferences--Java--Installed JREs 中的搜索按钮选择 JDK 11 根目录时,Eclipse 会显示“No JREs found”。 But JDK 11 can be added to the list of installed JREs by using the Add button.但是可以使用添加按钮将 JDK 11 添加到已安装的 JRE 列表中。 But when added what appears under the Name column of the Installed JREs box is JDK 11.0.2, not a JRE.但是添加后,Installed JREs 框的 Name 列下显示的是 JDK 11.0.2,而不是 JRE。 When one goes through the search button and the root directory of JDK 8 is selected, the message that says no JREs is not displayed and its JRE is very smoothly added to the installed JREs list.当通过搜索按钮选择JDK 8的根目录时,没有显示没有JREs的消息,并且它的JRE非常顺利地添加到已安装的JREs列表中。 For JDK 11, to be added to the list of installed JREs the Add button has to be used, not the search button.对于 JDK 11,要添加到已安装的 JRE 列表中,必须使用添加按钮,而不是搜索按钮。 I would like to know what this means?我想知道这是什么意思?

JDK 11 appears first in the Path variables of the user variables list. JDK 11 首先出现在用户变量列表的路径变量中。 After JDK 11, appears JDK 8. Even if Java 11 is returned for the command java -version Eclipse still says no JREs found in JDK 11. In the JDK 11.0.2 root folder, no jre folder is found.在 JDK 11 之后,出现 JDK 8。即使为命令java -version Eclipse 返回 Java 11 仍然说在 JDK 11 中没有找到 JRE。在 JDK 11.0.2 根文件夹中,没有找到 jre 文件夹。

Even though this question is marked as a duplicate, it's not so.尽管这个问题被标记为重复,但事实并非如此。 This question is about why Eclipse is behaving in a certain way regarding JDK 11 that's different from its behaviour regarding JDK 8.这个问题是关于为什么 Eclipse 在 JDK 11 方面的行为与它在 JDK 8 方面的行为不同。

I have never used the Search button (I always add JREs via the Add button) but I suspect that the button behavior was not updated for JDK 11. Since JDK 9, there is no more jre folder anymore.我从未使用过“搜索”按钮(我总是通过“添加”按钮添加 JRE),但我怀疑 JDK 11 的按钮行为没有更新。从 JDK 9 开始,不再有 jre 文件夹 So, it continues seeking for jre folder and since there is no, it fails.所以,它继续寻找 jre 文件夹,因为没有,它失败了。

In any way, I don't see any big reason to use the Search button.无论如何,我看不出使用“搜索”按钮的任何重要理由。 Just use the Add button.只需使用添加按钮。

The answer to the above question may be found at On Windows, installing Java 11 .上述问题的答案可以在On Windows, installed Java 11 中找到 Part of it is as follows.部分内容如下。 I now think that the page led to by the link above is not the right answer.我现在认为上面链接所指向的页面不是正确的答案。

On Windows, installing Java 11 may not fix your problem.在 Windows 上,安装 Java 11 可能无法解决您的问题。 The Oracle Java 11 installer does not appear to register itself as the default JRE on the system path, or place its entries in the expected location of the system registry. Oracle Java 11 安装程序似乎不会将自己注册为系统路径上的默认 JRE,也不会将其条目放在系统注册表的预期位置。

As such, even if you plan to use Java 11 in your development environment, you should consider also installing Java 8 so that your system path has a JRE/JDK usable as the default for any current or older Eclipse version.因此,即使您计划在您的开发环境中使用 Java 11,您也应该考虑安装 Java 8,以便您的系统路径具有 JRE/JDK 可用作任何当前或旧 Eclipse 版本的默认值。

But why wasn't JDK -11 added to the list of Installed JREs when Eclipse was restarted after Path variables were updated and the command java -version returned java version "11.0..-..." My question is why didn't anybody knowledgable about this issue didn't reply.但是为什么在 Path 变量更新后重新启动 Eclipse 并且命令java -version返回java version "11.0..-..."时,JDK -11 没有添加到已安装的 JRE 列表中,我的问题是为什么没有人了解这个问题的没有回复。 Some marked the question as duplicate even.有些人甚至将问题标记为重复。

转到您的 Java 文件夹并检查里面是否有 jre 文件夹,否则只需再次下载 JDK 并重新安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 JDK11迁移:Eclipse 2018-12中显示了编译错误,但是代码运行正常 - JDK11 Migration: Compilation error shown in Eclipse 2018-12 but code runs fine SQLDEVELOPER:未找到安装了 JDK-11 的 JDK - SQLDEVELOPER: JDK Not Found with JDK-11 installed Ant 任务定义 OpenJDK 11 JavaFX SDK 11 Eclipse 2018-12 - Ant tasks definitions OpenJDK 11 JavaFX SDK 11 Eclipse 2018-12 为什么 Eclipse 2018-12 会问是否创建模块的问题? - Why does Eclipse 2018-12 asks the question whether to create a module or not? 版本 2018-12 (4.10.0) 中的 Eclipse 调试器不起作用 - Eclipse Debugger in version 2018-12 (4.10.0) not working @Before 和 @After 不能在 Eclipse 2018-12 JAVA 上使用 JUnit 5 - @Before and @After not working with JUnit 5 on Eclipse 2018-12 JAVA 无法将Codemix插件安装到Eclipse 2018-12 - can't install codemix plugin to eclipse 2018-12 InjectionException-Eclipse 2018-12 e4导出 - InjectionException - Eclipse 2018-12 e4 export 导出的可运行 jar 不包含来自 eclipse 2018-12 和 java 11 的依赖 jar。我们如何解决这个问题? - exported runnable jar doesn't contain dependency jars from eclipse 2018-12 with java 11. How do we solve this? Eclipse:在Eclipse版本中更改了ctrl + shift + / format的块注释样式:2018-12(4.10.0) - Eclipse: Block comment style of ctrl+shift+/ format changed in Eclipse Version: 2018-12 (4.10.0)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM