KShukla
KShukla

Reputation: 1

Error: Unable to locate tools.jar

I am using windows 8 java installed in Program files. I am getting such error "Unable to locate tools.jar. Expected to find it in C:\Program Files (x86)\Java\jre1.8.0_40\lib\tools.jar"

After creating 2 system variables as"JAVA_HOME" with the path 'C:\Program Files\Java\jdk1.8.0_40' and "ANT_HOME" with the path 'D:\Software\apache-ant-1.9.4'. Then, I set the path variable to %JAVA_HOME%\bin; and ant variable to %ANT_HOME%\bin.

Still getting the same error as "Unable to locate tools.jar".

Also, I have tried by copy/pasting tools.jar from JDK lib to JRE lib folder. but had no luck. Getting the same error

Upvotes: 0

Views: 1673

Answers (2)

manik
manik

Reputation: 1

Hi same error was created by my system,but i am copy the tools.jar file and past in the jre/lib folder...that problem has been solved

Upvotes: 0

Mustafa sabir
Mustafa sabir

Reputation: 4360

For development purposes like compilation (javac) you will be needing a JDK. Since you get that error it means you might be running some functionality that uses JDK. Hence you will have to point to a JDK. Also ANT documentation recommends using JDK for full support of ANT features.

Note: If a JDK is not present, only the JRE runtime, then many tasks will not work.

Also looking at your question

I have tried by copy/pasting tools.jar from JDK lib to JRE lib folder ?

This is not a recommended approach you will need a full JDK. JDK has many things other than JRE + tools.jar

Upvotes: 0

Related Questions