Changing classpath in Eclipse
Solution 1
Since tools.jar is an JDK library you can add it for all projects by configuring your Execution Environment. In Preferences go to Java > Installed JREs select your JDK and click on Edit.... In the new Dialog you can add external jars like tools.jar to your execution environment. I hope you have installed the JDK 1.6 and not only the JRE 1.6 as you have written in your question.
Solution 2
To change the project JRE in Eclipse, you have to go into the project specific settings (select the project folder in the Package Explorer, then go in the project and then click on properties), where you will find the Java Build Path related settings.
In the Build Path section of the project settings, you have to go into the Libraries Tab:
From here, you have to double click on the JRE System Library and change the execution environment to JavaSe 1.6:
Solution 3
Add or Edit your eclipse Classpath Variables. It is under Window > Preferences > Java > Build Path directory of eclipse.For example;
JDK_HOME - C:/Program Files/Java/jdk1.6.0_24
Solution 4
rightclick on the project -> build path -> configure build path
...then you can change the jre for the project (from jre7 to jr6 maybe) and also remove all other libs that don't exists anymore.
Solution 5
Add your own classpath into eclipse :
Project->Run/Debug Settings->Edit->Classpath
Comments
-
Raheel almost 4 years
I recently uninstalled
jre7
and installedjre6
, as it was required by my project. But now my program is showing an error with the classpath. How can I change the classpath in Eclipse?The error is:
The archive: C:/Program Files/Java/jdk1.7.0_05/lib/tools.jar which is referenced by the classpath, does not exist.