Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ant needs tools.jar and unable to find it

I am putting together a dev environment for a Java program and after the first try of my Ant build scripts I got this error:

Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk/lib/tools.jar 

While the path to the jdk is correct, the tools.jar really wasn't there. Is it actually supposed to be there or did I get some config/installation thing wrong?

like image 858
Genadinik Avatar asked Apr 05 '11 23:04

Genadinik


People also ask

Where is the jar tool located?

Typically, it should be in the lib/ directory of your jvm. On Ubuntu/Debian, it is located in directory /usr/lib/jvm/java-xxxxx/lib/tools. jar .

Does openjdk include jre?

The openjdk-6-jre package contains just the Java Runtime Environment. If you want to develop Java programs then install the openjdk-6-jdk package.

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.


1 Answers

It seems like you can have Java installed in /usr/lib/jvm/java-6-openjdk but only have the JRE, not the JDK. This fixed it for me:

sudo apt-get install openjdk-6-jdk

like image 98
Kevin Qi Avatar answered Oct 02 '22 16:10

Kevin Qi