Raheel
Raheel

Reputation: 5163

Changing classpath in Eclipse

I recently uninstalled jre7 and installed jre6, 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.

Upvotes: 4

Views: 75457

Answers (5)

aleroot
aleroot

Reputation: 72676

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:

enter image description here

From here, you have to double click on the JRE System Library and change the execution environment to JavaSe 1.6:

JRE edit

Upvotes: 8

wangkaibule
wangkaibule

Reputation: 848

Add your own classpath into eclipse : Project->Run/Debug Settings->Edit->Classpath

Upvotes: 1

Tobias Willig
Tobias Willig

Reputation: 1144

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.

Upvotes: 7

Chris S.
Chris S.

Reputation: 333

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.

Upvotes: 1

Sai Ye Yan Naing Aye
Sai Ye Yan Naing Aye

Reputation: 6738

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

Upvotes: 1

Related Questions