When you run ant, if you get an error/warning that says unable to locate tools.jar, eg:
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar
or you're seeing the wrong java version from the one you set in JAVA_HOME, then try changing your JAVA_HOME environment variable. Mine was set to "C:\Program Files\Java\jdk5\bin", and I had to remove the "\bin" part, because ant looks for "%JAVA_HOME%\bin\java*". So for example, with the "\bin" part, ant looks for "C:\Program Files\Java\jdk5\bin\bin\java.exe".


Thank you for a clear and simple explanation.
Posted by: Ivan | 07/11/2010 at 08:43 AM
thanks this fixed my problem
Posted by: bruno | 10/17/2010 at 03:43 PM
Thank you! It works now!)
Posted by: Alex | 05/19/2011 at 02:54 AM
Thanks so so much for the clear and consise solution.
Posted by: Kelli | 07/01/2011 at 06:50 AM