1. Install ant
Go to the official homepage http://ant.apache.org to download the new version (currently Ant1.8.1) ANT, which gets a compressed package of Apache -NT-1.8.1-bin.zip. Unzip it on your hard disk, for example: C: /APACHE-AT-1.8.1.
Second, configuration environment variable
Set an Ant environment variable in Window:
Ant_home C:/ Apache-AT -.8.1
PATH C:/ Apache-Or
ClassPath C: /APache-AT-1.8.1/lib
Notice:【
Configuration environment variable: My computer ------------------------- Environment variables such
PATH:%ANT_HOME%/Bin (for the convenience of operating in the DOS environment)
The experiment is always failed. There is no way to replace the address C:/ Apache-AT-1.8.1/ Bin without using variables. Essence Essence Successful. Essence
.
Third, verify ant
In order to verify whether the ANT is successfully installed, the following operations can be performed:
Select in order: Start-> Run-> CMD, enter the following command: ant
If the following content appears, the installation is successful:
Copy code code as follows:
Buildfile: Build.xml Does Not Exist!
Build failed
[Explain that ANT installation is successful! Because ANT runs the built.xml default, this file needs to be established. .
View version: ant -version
But if the following content appears, the installation fails: (you can repeat the above steps until the installation is successful.)
'ANT' is not internal or external commands, nor is it running program or batch files.
Move from elsewhere:
use:
(1) Create BUILD.XML in the root directory
Copy code code as follows:
<? xml version = "1.0" encoding = "gbk"?>
<project name = "Test script" default = "Copyfile" Basedir = ".">
<target name = "copyfile">
<copy file = "d: /a.txt" todir = "E:/Temp" Overwrite = "TRUE"/>/>
</target>
</project>
(2) Create a file A.TXT in the DBR root directory.
(3) Enter DOS,
d:
ant
At this time, you can see the file AA.TXT in the E:/TEMP directory. The content is the same as A.TXT, that is, the copy is successful!