Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\li b\tools.jar

When I try to run the following command I get an error:

$ ant -Dsdk.dir=/opt/google/appengine-java-sdk runserver -Dserver.host=192.168.1.10

Here is the error:

"Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\li b\tools.jar".

I have given jdk path in JAVA_HOME variable as C:\PROGRA~1\Java\jdk1.6.0_25 as my jdk location is C:\Program Files (x86)\Java\jdk1.6.0_25.

What is the issue? Please help me.Thanks in advance.

When I have tried to run the command ant -diagnostics , I got

java.home : C:\Program Files\Java\jre6
like image 537
user1767260 Avatar asked Jan 18 '13 08:01

user1767260


People also ask

What is the use of tools jar in Java?

The jar command is a general-purpose archiving and compression tool, based on the ZIP and ZLIB compression formats. Initially, the jar command was designed to package Java applets or applications; however, beginning with JDK 9, users can use the jar command to create modular JARs.

Where can I find tools jar in JRE?

Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib ools.jar I searched for tools.jar in the ant lib folder, in the java 64 and 32, but no trace of it in the system. What do you think ? A JRE doesn't have a tools.jar, you need a JDK. Set your JAVA_HOME and PATH variables so that they point to a JDK, not a JRE.

Why can't I see tools in a JRE?

A JRE doesn't have a tools.jar, you need a JDK. Set your JAVA_HOME and PATH variables so that they point to a JDK, not a JRE. on Windows try restarting your computer, worked for me after. Is Windows the only OS where restarting means you lose your currently open Windows? I just restart the cmd console until I see changes propagated there.

Where can I find OOLs jar in Java?

Expected find it in C:\Program Files\Java\jre7\lib ools.jar - Stack Overflow ant build : unable to locate tools.jar. Expected find it in C:\Program Files\Java\jre7\lib ools.jar

How can I recover a broken Java tool jar?

To Recover this problems you can just copy the tools.jar from "C:\ProgramFiles\Java\jdk1.7.0\lib" directly into "C:\Program Files\Java\jre7\lib".You will successfully recover the problems. It works!.. Show activity on this post. I solved issue with setting %JAVA_HOME% to start of the PATH. It worked for me when I set it exactly to the start.


1 Answers

You should try adding %JAVA_HOME%\bin at the beginning of your PATH environment variable (given syntax assumes Windows of course). As Peter Knego commented, tools.jar exists in the JDK, not the JRE, so you must make sure the JAVA_HOME points to your JDK directory.

like image 184
Patrice M. Avatar answered Oct 05 '22 01:10

Patrice M.