Possible Duplicate:
Unable to locate tools.jar
I'm trying to use ant to compile using this command :
ant compile
I don't know if the problem comes from my windows 64bit, or by something else. Because I have java Installed in the 64 & 32 prog files.
I downloaded apache-ant-1.8.2-bin
and putted it in C:\Program Files\apache-ant-1.8.2
I tried to put ant everywhere, I switched also the ENV PATH between java 64 and 32 but everytime I get this error message :
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.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 ?
You need to find where the JDK is, in my case: D:\Program Files\Java\jdk1. 8.0_11 , and if you look in the lib directory, you will see Tools. jar . Re-open command prompt and should run.
jar in /usr/lib/jvm/java-1.7.
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.
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.
I had similar issue and got solved by doing following ,
1) set JAVA_HOME as C:\Program Files (x86)\Java\jdk1.7.0\
2) ANT_HOME as F:\ant\apache-ant-1.8.4-bin\apache-ant-1.8.4
3) add both to 'path ' in system variables
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