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