Apache Ant-1.6.2

Introduction to Apache Ant

The Apache Ant package is a Java-based build tool. In theory, it is kind of like make, but without make's wrinkles. Ant is different. Instead of a model where it is extended with shell-based commands, Ant is extended using Java classes. Instead of writing shell commands, the configuration files are XML-based, calling out a target tree where various tasks get executed. Each task is run by an object that implements a particular task interface.

Package Information

Additional Downloads

Apache Ant Dependencies



Installation of Apache Ant



You may need additional libraries to satisfy the build requirements of various packages installed using Apache Ant. Review the table at http://ant.apache.org/manual/install.html#librarydependencies for any prerequisite libraries you may need. One such library is the JUnit testing framework library. Many Ant-installed packages will use this library to perform the unit tests during the build process. To install the JUnit library along with the Apache Ant package, download it from http://www.junit.org/, unzip the distribution file (requires UnZip-5.52) and copy the junit.jar file into the lib subdirectory of the Apache Ant source tree before beginning the Apache Ant build.

Install Apache Ant by running the following commands:

patch -Np1 -i ../apache-ant-1.6.2-blfs_install-1.patch

Now, as the root user:

./build.sh -Ddist.dir=/opt/ant-1.6.2 dist &&
ln -v -sf /etc/ant /opt/ant-1.6.2/etc &&
ln -v -sf ant-1.6.2 /opt/ant

Command Explanations

./build.sh -Ddist.dir=/opt/ant-1.6.2 dist: This command does everything. It builds the package, then installs the package into /opt/ant-1.6.2.

ln -v -sf /etc/ant /opt/ant-1.6.2/etc: The patch changes the configuration directory to /etc/ant to conform with FHS guidelines. This command creates a symlink from the configuration directory back to the installation directory as the package is expecting to find the files there.

ln -v -sf ant-1.6.2 /opt/ant: This command is optional, and creates a convenience symlink.

Configuring Apache Ant

Config Files

/etc/ant/ant.conf, ~/.ant/ant.conf, and ~/.antrc

Configuration Information

Some packages will require ant to be in the search path and the $ANT_HOME environment variable defined. Satisfy these requirements by adding the following lines to /etc/profile or to individual user's ~/.profile or ~/.bashrc files:

export PATH=$PATH:/opt/ant/bin
export ANT_HOME=/opt/ant


Installed Programs: ant, antRun, antRun.pl, complete-ant-cmd.pl, runant.pl, and runant.py
Installed Libraries: ant-*.jar, xercesImpl.jar, and xml-apis.jar
Installed Directories: /etc/ant and /opt/ant-1.6.2

Short Descriptions


is a Java based build tool used by many packages instead of the conventional make program.


is a support script used to start ant build scripts in a given directory.


is a Perl script that provides similar functionality offered by the antRun script.


is a Perl script that allows Bash to complete an ant command-line.


is a Perl wrapper script used to invoke ant.


is a Python wrapper script used to invoke ant.


files are the Apache Ant Java class libraries.


is a Java class library used by Apache Ant to perform XML parsing.


contains the DOM Java classes required by the Apache Ant XML formatter.

Last updated on 2005-08-14 15:03:38 -0600