参考:
Set it permanently:
- Right click on My Computer
- Go to Advanced tab
- Click on "environment variables" button
- Under system variables, edit "JAVA_HOME", set value to new path
- Close all Command prompt windows - the variable does not update in existing command prompts, only new ones.
http://ant.apache.org/manual/install.html
Installing Ant on Windows
- Enter the URL: http://ant.apache.org/bindownload.cgi .
- On the Apache Ant Project page, find the heading Current Release of Ant .
- Select apache-ant-1.6.5-bin.zip [PGP] [SHA1] [MD5]
- Click Save to unzip the apache-ant-1.6.5-bin.zip [PGP] [SHA1] [MD5] file and save it to your C:/ directory as ant .
- Add the bin directory to your PATH environment variable.
- Add the ANT_HOME environment variable set to C:/ant .
- Add the ANT_OPTS environment variable set to -Xmx256M .