Unable to locate tools.jar
In case this is still an issue for anyone, I have a bit of clarification on the previous answers. I was running into this same issue using ant with only a JDK installed. Although, the JDK installer gave me a directory structure like this:
Directory of C:\Program Files\Java05/08/2012 09:43 AM <DIR> .05/08/2012 09:43 AM <DIR> ..05/08/2012 09:46 AM <DIR> jdk1.7.0_0405/08/2012 09:19 AM <DIR> jre605/08/2012 09:44 AM <DIR> jre7 0 File(s) 0 bytes
and when I ran ant, it complained about not finding tools.jar under the jre7 subdirectory. It wasn't until I set "JAVA_HOME=C:\Program Files\Java\jdk1.7.0_04"
that the error went away.
Install the Java SDK.
Add a System Environment Variable called JAVA_HOME with the value of JDK location.
Go to Control Panel\System and Security\System. Advanced System Settings, Environment Variables, System Variables, New... Example:
Variable Name:JAVA_HOME
Variable Value: C:\Program Files\Java\jdk1.7.0_21Close/reopen your CMD window so that the new variable takes effect before attempting to re-run the ant command.