Ant is a Java-based build tool. Everyone knows that there is already a lot of Build tools, such as make, gnumake, nmake, jam, etc., and these tools are very excellent. Then why should I introduce to the new tool of Ant? Because Ant is a cross-platform Build tool. The reason that Ant can cross the platform because Ant no longer needs you to write shell commands, Ant's profile is XML-based task tree, which allows you to run a variety of tasks, the task run is the implementation of a specific task interface Objects are completed.
Get Ant
Binary version: The latest stable version of the download address is: http://jakarta.apache.org/builds/ant/release/v1.1/bin.
SOURCE Edition: The latest source stabilization download address is: http://jakarta.apache.org/builds/ant/release/v1.1/src/. If you want to get the latest source code, the address is: http://jakarta.apache.org/from-cvs/jakarta-ant/
System Requirements
You need to include XML Parser compatible with JAXP in ClassPath to compile and use ANT.
I recommend an XML Parser: Xerces, Downloads: http://xml.apache.org/xerces
Of course, JDK is definitely necessary and is a 1.1 or later version.
Compile ANT
1. Enter the Jakarta-Ant directory
2. Add JDK to your PATH environment variable
3. Set the java_home environment variable to point to your JDK installation directory
4. Run Bootstrap.SH angle file
5. Run the following command to create a binary version of Ant:
Build.sh -dant.dist.dir =
Install ANT
1. Set an ANT_HOME environment variable to point to your Ant directory
2. Set the java_home environment variable to point to your JSK directory
3. Add ant_home / bin to the PATH environment variable
4. Add Ant.jar and Xerces.jar to the ClassPath environment variable
Suppose Ant is installed in the / usr / local / ant directory, you can set the following:
Export Ant_Home = / usr / local / Ant
Export java_home = / usr / local / jdk-1.2.2
Export Path = $ {Ant_Home} / bin: $ {pat}
Export classpath = $ {ant_home} /lib/ant.jar:
Run Ant
Running Ant is very simple, if you install Ant according to the methods described above, just type Ant on the command line.
When you run Ant without any parameters, Ant will find a file called build.xml in the current directory. If you find it, you will use the file as the build profile. If not found, it will automatically find the upper level directory, and have always found the root directory. Other profiles can also be specified by command line parameters -buildfile