Ant “Unable To Locate tools.jar”

Posted by guptaradhesh on April 6, 2011

While running an ant, if we get an error/warning that says unable to locate tools.jar, then we are seeing the wrong java version from the one you set in JAVA_HOME.

i.e. Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar

Just try changing your JAVA_HOME environment variable. In most cases either JAVA_HOME is not set or is set to “\jdk5\bin”, and they have to remove the “\bin” part, because ant looks for “%JAVA_HOME%\bin\java*”. This is because ant looks for “C:\Program Files\Java\jdk5\bin\bin\java.exe”.

Reference: web


2 Responses to “Ant “Unable To Locate tools.jar””

  1. Thanks Radhesh.

    Now I got rid of that error message.

    Thanks a lot.

  2. suresh said

    Thanks A lot Radhesh

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: