Building ant environment under Windows
First, install ant
Go to the official home page http://ant.apache.org to download the new version of ant (currently Ant1.8.1) and get a compressed package of apache-ant-1.8.1-bin.zip. Extract it to your hard drive, for example: C:\ apache-ant-1.8.1.
Second, configure environment variables
Set the ant environment variable in window:
ANT_HOME C:/ apache-ant-1.8.1
Path C:/ apache-ant-1.8.1/bin
Classpath C:/apache-ant-1.8.1/lib
Note: [
Configure environment variables: my computer-properties-advanced-environment variables
Such as: ANT_HOME:C:\ apache-ant-1.8.1
PATH:%ANT_HOME%\ bin (for convenience in dos environment)
The experiment always fails, and there is no way to change it to the address Carex / apache-ant-1.8.1/bin instead of using variables. It worked.
]
Third, verify ant
To verify that ant is installed successfully, do the following:
Select: start-> run-> cmd, and enter the following command: ant
If the following appears, the installation is successful:
Buildfile: build.xml does not exist!
Build failed
[this indicates that ant is installed successfully! Because ant runs the build.xml file by default, this file needs to be created. ]
View version: ant-version
However, if the following appears, the installation failed: (you can repeat the previous steps until the installation is successful. )
'ant' is not an internal or external command, nor is it a runnable program or batch file.