Where is tools.jar located?
Asked Answered
J

5

14

Running CentOS 6, Java 1.7.0_25 OpenJDK

Upon installing the RPM I saw it say

Unpacking JAR files...
rt.jar
jsee.jar
charsets.jar
>tools.jar

Where is tools.jar located? I checked /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.25.x86_64

No where to be found.

Jackal answered 5/8, 2013 at 15:25 Comment(0)
S
2

On windows, I could find it at \jdk1.7.0\lib. You can find java directory structure here

Solar answered 5/8, 2013 at 15:28 Comment(0)
L
32

Not sure what rpm you used, but if you install from yum repo, you should install java-1.7.0-openjdk-devel in addition to java-1.7.0-openjdk.

Then you will find tools.jar in /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.xx.x86_64/lib directory.

Lysis answered 19/11, 2013 at 13:53 Comment(2)
Just putting another emphasis on installing openjdk-devel in addition to openjdk. Tried and tested on Amazon Linux.Eddington
This solved my issue with apache-axis. I was getting this error: java.lang.RuntimeException: No compiler found in your classpath! (you may need to add 'tools.jar')Britt
S
7

On Linux, you can use locate tools.jar to find where the file is.

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.

For example, with openjdk 7, on amd64, I'll find it under /usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar.

I have no installation to check it, but I think that the directory structure is the same under CentOS (cf. https://serverfault.com/questions/50883/what-is-the-value-of-java-home-for-centos)

Sewerage answered 5/8, 2013 at 15:35 Comment(1)
This may be obvious, but out-of-the-box Ubuntu 16.04 did not have /usr/lib/jvm/java-*/lib/tools.jar until I ran sudo apt install openjdk-8-jdk (and locate won't work until you run sudo updatedb)Bed
C
6

Linux Centos 6,

you can use sudo find / -name "tools.jar" command to find the file location.

tools.jar is normally located under /usr/lib/jvm/java-1.7.0.70.x86_64/lib/tools.jar

tools.jar is not in JRE.

My case, tools.jar file is generated only after installing java-1.7.0-openjdk-devel.

sudo yum install java-1.7.0-openjdk-devel

Callas answered 18/6, 2015 at 7:8 Comment(1)
Could you please elaborate more your answer adding a little more description about the solution you provide?Beattie
S
2

On windows, I could find it at \jdk1.7.0\lib. You can find java directory structure here

Solar answered 5/8, 2013 at 15:28 Comment(0)
M
1

No,it should be in in Lib folder

JDK and JRE File Structure

c:\jdkx.x.x\lib

Files used by the development tools. These include tools.jar, which contains non-core classes for support of the tools and utilities in the JDK. Also includes dt.jar, the DesignTime archive of BeanInfo files that tell interactive development environments (IDE's) how to display the Java components and how to let the developer customize them for an application.

Millstream answered 5/8, 2013 at 15:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.