When trying to run a build with ant, the following issue comes up:

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

Unable to locate

First, ensure JDK, the Java Development Kit, is installed and copy the full path to the installation directory.

Installation directory

Then add an environment variable, Computer -> Properties -> Advanced system settings -> Environment variables…

Path

Create a new variable called JAVA_HOME and set the value to the directory path.