9

Yes, I read other posts here about the same thing. I made sure to install the JDK and not the JRE. I installed jdk-7u45-windows-x64 on my Win7 machine but there is no tools.jar file.

Is there some other Java SDK that I need to download and install?

I'm trying to run Ant.

RalphF
  • 373
  • 3
  • 10
  • 21
  • 2
    tools.jar is usually in lib directory in jdk. Did you look there? Have you installed ant already? What error do you face when you try to run `ant` ? – Nishan Dec 14 '13 at 01:19
  • 2
    Check that Ant is using the expected jdk by running `ant -diagnostics` – Nicolas Lalevée Dec 14 '13 at 01:24
  • 1
    Ensure you have set the [JAVA_HOME](http://ant.apache.org/manual/install.html) environment variable to the JDK root. – McDowell Dec 14 '13 at 15:08
  • http://stackoverflow.com/questions/6676107/unable-to-locate-tools-jar?rq=1 – Jayan Dec 15 '13 at 11:14
  • 1
    Ant -diagnostics shows that Ant is expecting to find tools.jar in C:\Program Files\Java\jre7\lib but I looked in that lib folder and tools.jar is not in there...but you're saying it shold be in the jdk java path? – RalphF Dec 16 '13 at 18:46
  • My JAVA_HOME is set to C:\Program Files\Java\jdk1.7.0_45\bin – RalphF Dec 16 '13 at 18:48
  • Ahhh tools.jar is in C:\Program Files\Java\jdk1.7.0_45\lib so that means my Java_Home is set wrong, it's set to bin and should be set to lib...I will change that and see if that now will work... – RalphF Dec 16 '13 at 18:50
  • I had to copy the tools.jar from the C:\Program Files\Java\jdk1.7.0_45\lib location to the C:\Program Files\Java\jre7\lib location and Ant is finally working...thanks guys... – RalphF Dec 16 '13 at 18:55

1 Answers1

4

tools.jar is located in jdk_home/lib

Evgeniy Dorofeev
  • 133,369
  • 30
  • 199
  • 275
  • 7
    Except that sometimes it is not, hence this error even though the JDK installation is recognized. Likely a non-clean previously executed uninstallation process. – Koenigsberg Sep 10 '19 at 10:26
  • @Koenigsberg what have you done to solve the error then? – Mez13 Nov 10 '20 at 14:08