Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to locate tools.jar [duplicate]

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.

Java 64 & 32

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 ?

like image 225
Wassim AZIRAR Avatar asked Jul 13 '11 08:07

Wassim AZIRAR


People also ask

Could not find tools jar in JDK?

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.

Where is tools jar?

jar in /usr/lib/jvm/java-1.7.

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.


2 Answers

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.

like image 58
Sean Patrick Floyd Avatar answered Sep 30 '22 06:09

Sean Patrick Floyd


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

like image 33
Pramod Avatar answered Sep 30 '22 07:09

Pramod