I use Mac OS, 10.6 and after recovering my back-up data, Eclipse stopped working. It gives me the following errors:
The container 'JRE System Library [JavaSE-1.6]' references non existing library '/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar'
Unbound classpath container: 'JRE System Library [JavaSE-1.7]' in project 'Proba'
I attempted to install again Java Development Kit (Help -> Install new software), and Eclipse actually installed it, but when I go to (Eclipse -> Preferences -> Java -> Installed JREs), I get error "Installed JRE location no longer exists. JRE will be removed. Reason: JRE removed"
, and installed JREs window is indeed empty. And the Java code still doesn't compile.
Solution: Go to: Eclipse -> Preferences -> Java -> Installed JREs -> Execution Environment
and choose the JAVA SE 6 package (possibly JAVA SE 7 could work) and then choose the compatible JREs in the right-hand side.
Reload Eclipse.
Two possibilities:
1. Update the Installed JRE
(Depending on the issue, one of the following will do)
Remove and Recreate the Installed JREs
instance for the failing JVM.
Eclipse -> Preferences -> Java -> Installed JRE
Install a new version of Java. (You can get it here), then Create a new instance using Eclipse's 'Installed JREs'. Set it as the default.
Eclipse -> Preferences -> Java -> Installed JRE
(As you noted)
2. Update the Execution Environment
such that it is compatible with the JRE.
Go to Eclipse -> Preferences -> Java -> Installed JREs -> Execution Environment
and select a compatible env.
Here is how to fix things up:
Some versions in Mac like Lion does not come with a JDK; you can go and download one directly from http://connect.apple.com. Yes you need to sign up and login with your apple id. The download column is over on the right; and you should be able to find your way.
The jdk is installed into a different location. This will result in IDEs (such as Eclipse) being unable to locate source code and javadocs.
At the time of writing the JDK ended up here: /Library/Java/JavaVirtualMachines/1.6.0_31-b04-415.jdk/Contents/Home Please go ahead and have a look to confirm where your JDK ended up; this will no doubt change over time.
Open up eclipse preferences and go to Java --> Installed JREs page
Rather than use the "JVM Contents (MacOS X Default) we will need to use the above JDK location
At the time of writing the Search button was not aware of the new JDK location; we we will need to click on the Add button and hunt it down ourselves.
From the Add JRE wizard choose "MacOS X VM" for the JRE Type
For the JRE Definition Page we need to fill in the following: JRE Home:/Library/Java/JavaVirtualMachines/1.6.0_26-b03-383.jdk/Contents/Home
The other fields will now auto fill, with the default JRE name being "Home". You can quickly correct this to something more meaningful: JRE name:System JDK
Finish the wizard and return to the Installed JREs page
Choose "System JDK" from the list You can now developer normally with javadocs correctly shown for for the base classes like java.lang.String, source code correctly shown when debugging.
The error above is simply saying that the Eclipse variable your JREs/JDKs have moved and the relevant variables defined within Eclipse point to locations that no longer exist now.
All you have to do is to point those variables to the new location, and the methods suggested above are good to go.
4 Possible Alternatives:
One more thing which you can try is, to restore the Eclipse to Default state, i.e., re-install the version of Eclipse which you are using.(By the way, this worked for me, when I had a similar issue).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With