Could not find tools.jar

Possible duplicate:
Unable to find tools.jar

I am trying to use ant to compile with this command:

ant compile 

I do not know if a problem arises from my windows 64 bit or something else. Because I have Java installed in 64 and 32 prog files.

Java 64 & 32

I downloaded apache-ant-1.8.2-bin and put it in C: \ Program Files \ apache-ant -1.8.2

I tried putting ant everywhere, I also switched ENV PATH between java 64 and 32, but every time I get this error message:

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

I searched tools.jar in the ant lib folder, in java 64 and 32, but did not track it on the system.

What do you think?

+62
java compilation build apache ant
Jul 13. '11 at 8:26
source share
5 answers

There is no tool in the JRE. jar, you need JDK. Set the JAVA_HOME and PATH variables so that they point to the JDK, not the JRE.

+138
Jul 13 '11 at 8:30
source share

I had a similar problem, and I decided to solve it by following these steps:

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 paths to system variables

+19
Nov 01
source share

Please make sure you point to the JDK, not the JRE. For example, you should set JAVA_HOME as "C: \ Program Files \ java \ jdk1.6.0_26" and have% JAVA_HOME% \ bin in your system path.

+3
Jul 13 '11 at 8:30
source share

I had to copy C: \ Program Files \ Java \ jdk1.6.0_26 \ lib \ tools.jar to C: \ Program Files \ Java \ jre6 \ lib \ ext

Thank you anyway.

+3
Jul 13. 2018-11-11T00:
source share

tools.jar comes with the JDK, but what happens in your case, it looks for it in / Java / jre 6. Change the JAVA_HOME env var to one of your JDK houses.

+3
Jul 13 2018-11-11T00:
source share



All Articles