Eclipse:指定的JRE安装不存在

时间:2020-12-19 23:02:44

I used to have Eclipse configured well and work fine before. But I just uninstalled it and installed Eclipse Juno again on my Mac OS 10.10 today. But I kept getting this error: "The specified JRE does not exist."

我曾经很好地配置Eclipse并且之前工作正常。但是我刚卸载它并在今天的Mac OS 10.10上再次安装了Eclipse Juno。但我一直收到这个错误:“指定的JRE不存在。”

I know it's a pretty simple and commonly seen problem, I just needed to install JRE and/or JDK into this clean Eclipse, however things didn't get work out.

我知道这是一个非常简单且常见的问题,我只需要将JRE和/或JDK安装到这个干净的Eclipse中,但事情并没有解决。

And I've searched extensively on Stack Overflow: The posts I've looked at including: How to install JRE 1.7 on Mac OS X and use it with Eclipse? I followed exactly what the accepted answer said, but after having downloaded the JDK from http://www.oracle.com/technetwork/java/javase/downloads/index.html and installed it, I was going to add it to Eclipse via Preferences -> Java -> Installed JREs, however, I didn't see it as expected, the following is a screenshot of what I saw when I went to Preferences -> Java -> Installed JREs

我在Stack Overflow上进行了广泛的搜索:我看过的帖子包括:如何在Mac OS X上安装JRE 1.7并将其与Eclipse一起使用?我完全按照接受的答案说,但在从http://www.oracle.com/technetwork/java/javase/downloads/index.html下载了JDK并安装它之后,我打算通过它将它添加到Eclipse中首选项 - > Java - >已安装的JRE,但是,我没有按预期看到它,以下是我在首选 - > Java - >已安装的JRE时看到的屏幕截图

Eclipse:指定的JRE安装不存在

But the screenshot just says the installed JREs list is BLANK, I couldn't add any JRE into my Eclipse.

但屏幕截图只是说已安装的JRE列表是BLANK,我无法将任何JRE添加到Eclipse中。

Help please?

Also, I've tried other things that people have suggested: Properties -> Java Build Path what I see here is: JRE System Library OSGi/Minimum-1.2 with a red crossing sign in front of it (indicating something wrong with it?) So, I'm also blocked with this approach.

另外,我尝试过其他人建议的东西:属性 - > Java构建路径我在这里看到的是:JRE系统库OSGi / Minimum-1.2前面有一个红色交叉标志(表示它有问题吗?)所以,我也被阻止了这种方法。

Eclipse:指定的JRE安装不存在

6 个解决方案

#1


26  

I had the same problem. This is how I fixed it.

我有同样的问题。这是我修复它的方式。

  1. Open Eclipse.
  2. Go to Preferences.
  3. 转到首选项。

  4. Click Add
  5. A Window should popup with this:
  6. 应该弹出一个窗口:

Eclipse:指定的JRE安装不存在

  1. Select Standard VM.
  2. 选择标准VM。

  3. Select Directory
  4. Use this path: Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/
  5. 使用此路径:Library / Java / JavaVirtualMachines / jdk1.7.0_45.jdk / Contents / Home /

  6. Click Open
  7. Then Finish
  8. Right click your Project then click Properties
  9. 右键单击您的项目,然后单击属性

  10. Select Java Build Path then click Add Library
  11. 选择Java Build Path,然后单击Add Library

  12. Select JRE System Library
  13. 选择JRE系统库

Eclipse:指定的JRE安装不存在

  1. Click Environments and select the jdk1.7.0_45
  2. 单击“环境”,然后选择jdk1.7.0_45

  3. Finish

This is what you should see if you did it right:

如果你做得对,你应该看到这个:

Eclipse:指定的JRE安装不存在

#2


21  

Your run configurations maybe trying to use a specific JRE.

您的运行配置可能尝试使用特定的JRE。

Eclipse:指定的JRE安装不存在

Make sure you are using the correct JRE there.

确保你在那里使用正确的JRE。

#3


14  

The problem is generally related to project or plugin-specific runtime configurations that (still) point to some JDK/JRE that is not existing anymore (e.g. after some update or migration).

该问题通常与项目或特定于插件的运行时配置有关,这些配置(仍然)指向不再存在的某些JDK / JRE(例如,在某些更新或迁移之后)。

We had this e.g. with the ANT plugin, where the launch configuration had to be updated (per ant build file), if it was e.g. not set to the default ~ run in same JRE as workspace.

我们有这个,例如使用ANT插件,其中必须更新启动配置(每个ant构建文件),如果它是例如未设置为默认值〜在与工作空间相同的JRE中运行。

You will find these settings (typicall under the JRE tab) either:

您将找到这些设置(典型的JRE选项卡下):

  1. in the global plugin configuration under Eclipse -> Window -> Preferences -> ... of your plugin (typing runtime in the Filter section above may help to find it quickly).

    在Eclipse的全局插件配置 - > Window - > Preferences - >你的插件中(在上面的Filter部分输入runtime可能有助于快速找到它)。

  2. or it is set in a project/file-specific run configuration which you should see if you go to

    或者它是在项目/文件特定的运行配置中设置的,如果你去,你应该看到

    • Eclipse -> Run -> Run configurations... or
    • Eclipse - >运行 - >运行配置...或

    • right click on your project/file and select Run As -> Run Configurations ...
    • 右键单击您的项目/文件,然后选择Run As - > Run Configurations ...

  3. or it is set in a project/file-specific external tool configuration (e.g. like used by ANT) which is similarly to be found here:

    或者它是在项目/文件特定的外部工具配置中设置的(例如像ANT使用的那样),类似于此处:

    • Eclipse -> Run -> External Tools -> External Tools Configuration ... or
    • Eclipse - >运行 - >外部工具 - >外部工具配置...或

    • right click on your project/file and select Run As -> External Tool Configurations ...
    • 右键单击您的项目/文件,然后选择Run As - > External Tool Configurations ...

#4


4  

In eclipse click Window –> Show view –> Servers

在eclipse中单击Window - > Show view - > Servers

Once you are in servers view double click configured server to open its configuration and click Runtime environment link (in the left side).

进入服务器视图后,双击已配置的服务器以打开其配置,然后单击运行时环境链接(在左侧)。

Select the JRE and click finish.

选择JRE并单击“完成”。

Hope it help you

希望它对你有所帮助

#5


2  

I had the problem with one particular run configuration (unittests for one project in my case). In Run Configurations, I selected the troubled run configuration, then the JRE tab, and I could see it was broken (even though I couldn’t tell how it had happened). Selecting the right JRE solved my problem (project JRE in my case, even though this was just my standard JRE and not configured for the project specifically).

我遇到了一个特定运行配置的问题(在我的情况下,一个项目的单元测试)。在运行配置中,我选择了故障运行配置,然后选择了JRE选项卡,我可以看到它已损坏(即使我不知道它是如何发生的)。选择正确的JRE解决了我的问题(在我的情况下项目JRE,即使这只是我的标准JRE而没有专门为项目配置)。

#6


1  

I had the same problem. This solution might help fix the issue as it did for me.

我有同样的问题。此解决方案可能有助于解决问题,因为它对我来说。

  1. Right click on the project -> Build Path -> Configure Build Path
  2. 右键单击项目 - >构建路径 - >配置构建路径

  3. In the Libraries tab, select JRE System Library and click Edit
  4. 在“库”选项卡中,选择“JRE系统库”,然后单击“编辑”

  5. In the Edit window you can either select Workspace default JRE or in Execution environment drop down select the JRE installed
  6. 在“编辑”窗口中,您可以选择“工作区”默认JRE,也可以在“执行环境”下拉列表中选择已安装的JRE

#1


26  

I had the same problem. This is how I fixed it.

我有同样的问题。这是我修复它的方式。

  1. Open Eclipse.
  2. Go to Preferences.
  3. 转到首选项。

  4. Click Add
  5. A Window should popup with this:
  6. 应该弹出一个窗口:

Eclipse:指定的JRE安装不存在

  1. Select Standard VM.
  2. 选择标准VM。

  3. Select Directory
  4. Use this path: Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/
  5. 使用此路径:Library / Java / JavaVirtualMachines / jdk1.7.0_45.jdk / Contents / Home /

  6. Click Open
  7. Then Finish
  8. Right click your Project then click Properties
  9. 右键单击您的项目,然后单击属性

  10. Select Java Build Path then click Add Library
  11. 选择Java Build Path,然后单击Add Library

  12. Select JRE System Library
  13. 选择JRE系统库

Eclipse:指定的JRE安装不存在

  1. Click Environments and select the jdk1.7.0_45
  2. 单击“环境”,然后选择jdk1.7.0_45

  3. Finish

This is what you should see if you did it right:

如果你做得对,你应该看到这个:

Eclipse:指定的JRE安装不存在

#2


21  

Your run configurations maybe trying to use a specific JRE.

您的运行配置可能尝试使用特定的JRE。

Eclipse:指定的JRE安装不存在

Make sure you are using the correct JRE there.

确保你在那里使用正确的JRE。

#3


14  

The problem is generally related to project or plugin-specific runtime configurations that (still) point to some JDK/JRE that is not existing anymore (e.g. after some update or migration).

该问题通常与项目或特定于插件的运行时配置有关,这些配置(仍然)指向不再存在的某些JDK / JRE(例如,在某些更新或迁移之后)。

We had this e.g. with the ANT plugin, where the launch configuration had to be updated (per ant build file), if it was e.g. not set to the default ~ run in same JRE as workspace.

我们有这个,例如使用ANT插件,其中必须更新启动配置(每个ant构建文件),如果它是例如未设置为默认值〜在与工作空间相同的JRE中运行。

You will find these settings (typicall under the JRE tab) either:

您将找到这些设置(典型的JRE选项卡下):

  1. in the global plugin configuration under Eclipse -> Window -> Preferences -> ... of your plugin (typing runtime in the Filter section above may help to find it quickly).

    在Eclipse的全局插件配置 - > Window - > Preferences - >你的插件中(在上面的Filter部分输入runtime可能有助于快速找到它)。

  2. or it is set in a project/file-specific run configuration which you should see if you go to

    或者它是在项目/文件特定的运行配置中设置的,如果你去,你应该看到

    • Eclipse -> Run -> Run configurations... or
    • Eclipse - >运行 - >运行配置...或

    • right click on your project/file and select Run As -> Run Configurations ...
    • 右键单击您的项目/文件,然后选择Run As - > Run Configurations ...

  3. or it is set in a project/file-specific external tool configuration (e.g. like used by ANT) which is similarly to be found here:

    或者它是在项目/文件特定的外部工具配置中设置的(例如像ANT使用的那样),类似于此处:

    • Eclipse -> Run -> External Tools -> External Tools Configuration ... or
    • Eclipse - >运行 - >外部工具 - >外部工具配置...或

    • right click on your project/file and select Run As -> External Tool Configurations ...
    • 右键单击您的项目/文件,然后选择Run As - > External Tool Configurations ...

#4


4  

In eclipse click Window –> Show view –> Servers

在eclipse中单击Window - > Show view - > Servers

Once you are in servers view double click configured server to open its configuration and click Runtime environment link (in the left side).

进入服务器视图后,双击已配置的服务器以打开其配置,然后单击运行时环境链接(在左侧)。

Select the JRE and click finish.

选择JRE并单击“完成”。

Hope it help you

希望它对你有所帮助

#5


2  

I had the problem with one particular run configuration (unittests for one project in my case). In Run Configurations, I selected the troubled run configuration, then the JRE tab, and I could see it was broken (even though I couldn’t tell how it had happened). Selecting the right JRE solved my problem (project JRE in my case, even though this was just my standard JRE and not configured for the project specifically).

我遇到了一个特定运行配置的问题(在我的情况下,一个项目的单元测试)。在运行配置中,我选择了故障运行配置,然后选择了JRE选项卡,我可以看到它已损坏(即使我不知道它是如何发生的)。选择正确的JRE解决了我的问题(在我的情况下项目JRE,即使这只是我的标准JRE而没有专门为项目配置)。

#6


1  

I had the same problem. This solution might help fix the issue as it did for me.

我有同样的问题。此解决方案可能有助于解决问题,因为它对我来说。

  1. Right click on the project -> Build Path -> Configure Build Path
  2. 右键单击项目 - >构建路径 - >配置构建路径

  3. In the Libraries tab, select JRE System Library and click Edit
  4. 在“库”选项卡中,选择“JRE系统库”,然后单击“编辑”

  5. In the Edit window you can either select Workspace default JRE or in Execution environment drop down select the JRE installed
  6. 在“编辑”窗口中,您可以选择“工作区”默认JRE,也可以在“执行环境”下拉列表中选择已安装的JRE