Eclipse: The specified JRE installation does not exist

蹲街弑〆低调 提交于 2019-11-29 11:25:25

问题


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."

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.

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

But the screenshot just says the installed JREs list is BLANK, I couldn't add any JRE into my 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.


回答1:


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

  1. Open Eclipse.
  2. Go to Preferences.
  3. Click Add
  4. A Window should popup with this:

  1. Select Standard VM.
  2. Select Directory
  3. Use this path: Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/
  4. Click Open
  5. Then Finish
  6. Right click your Project then click Properties
  7. Select Java Build Path then click Add Library
  8. Select JRE System Library

  1. Click Environments and select the jdk1.7.0_45
  2. Finish

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




回答2:


Your run configurations maybe trying to use a specific JRE.

Make sure you are using the correct JRE there.




回答3:


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).

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.

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

  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).

  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
    • right click on your project/file and select 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:

    • Eclipse -> Run -> External Tools -> External Tools Configuration ... or
    • right click on your project/file and select Run As -> External Tool Configurations ...



回答4:


In eclipse click 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.

Hope it help you




回答5:


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).




回答6:


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. In the Libraries tab, select JRE System Library and click Edit
  3. In the Edit window you can either select Workspace default JRE or in Execution environment drop down select the JRE installed



回答7:


This happened to me when I updated Java. Though it was updated in my system, it didn't update the references in eclipse. I was working on web projects so I had to do the following steps

  1. Windows > Preferences > Java > Installed JREs (here the old version was present without showing any error) > Remove any old versions that are not present in your system and Add latest release or the present ones.

  2. Confirm Build Path of your projects and confirm they are pointing at the correct JRE. Project > Build Path > Check JRE version is correct

After doing this my project still gave me the same error so I checked JRE for my tomcat servers setup in eclipse

  1. Window > Preferences > Server > Runtime Enviroments > Select each server and edit it, reselect the jre and apply (it took me some time here to make eclipse realise i had the correct JRE selected).

Thats it, try running now it it should work.




回答8:


Main Cause of this Error is You Maybe forgot the set Build patch. When you Import Old Project this time Old Java Build Patch Existing You Have to give New One which one you currently using in your work space.

Process:- Right Click Project -> Build patch -> Configure Build path-> Add Library-> System Library-> Set JRE (Default or Alternative)



来源:https://stackoverflow.com/questions/26477692/eclipse-the-specified-jre-installation-does-not-exist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!