From: http://blog.csdn.net/zygsee/article/details/4457701
If ant is installed for half a day in the evening, it is not configured. Experience:
1. Install and deploy the Configuration:
(1) download: Apache ant http://ant.apache.org/bindownload.cgi
(2) configuration: for example, JDK is installed in C:/JDK; ant is installed in C:/ant.
Set environment variables:
Java_home: C:/JDK
Ant_home: C:/ant
Path: % PATH %; % java_home %; % ant_home %
(3) test: Open CMD and enter ant-version to display properly.
2. Unable to locate tools. Jar
I have never set java_home before. Generally, it is written directly to the path in full path. Enter ant to prompt "unable to locate tools. Jar ".
Later, I set it to jdk_home ant_home and enter ant !! Dizzy
In notepad, open "ant. Bat" and check that it is retrieved from java_home. The change of "jdk_home" to "java_home" is successful !!
3. Small solution: it seems that some plug-ins still need to set the java_home variable. Using the full path is still unreliable !!