Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tools jar does not exist Eclipse JAVA

Tags:

java

eclipse

The archive: C:/Java/jdk1.6.0_26-32/lib/tools.jar which is referenced by the classpath, does not exist.

This is the error I have when run Tomcat. There was no problem cleaning or publishing - only when i start the Tomcat server.

Now, I checked my folders and there is a tools.jar in file path C:\Java\jdk1.6.0_34\lib

What am i missing?

using jre6 and have jdk1.6.0_34 installed

like image 332
bouncingHippo Avatar asked Mar 26 '13 16:03

bouncingHippo


People also ask

Is tools jar available in JDK 11?

I realised no tools. jar exists in the Windows build of OpenJDK 11.

Could not find tools jar in Eclipse?

If you're using newer Java versions, it could happen that during the start of STS/Eclipse you get error saying that tools. jar could not be found. Since this tools. jar library could not be found in JRE, what you need to do is make your STS/Eclipse use JDK since it contains tools.


2 Answers

I found this question trying to build my project using Ant in Eclipse, and I would get the same error message as above. The suggestions in @Parth's and other answers to edit the Installed JREs is the first step. What I also needed to run Ant successfully was

  1. Right click on build.xml, select "Run As", select "Ant Build..." (note the ...)
  2. Click on the JRE tab
  3. Change the Runtime JRE to the same thing that you updated in the first stage, and press Apply. (That is, the runtime JRE as you specified by "Preferences" -> "Java" -> "Installed JREs", as in @Parth's answer.)

Otherwise it seems that Ant will still try to build with the old JRE that doesn't have tools.jar. Hope this helps someone.

like image 75
Micah Smith Avatar answered Oct 05 '22 00:10

Micah Smith


Right click on your eclipse project, 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.

like image 32
Parth Soni Avatar answered Oct 05 '22 01:10

Parth Soni