Apache Ant is an open-source tool for automating Java program build process. Similar to how the make utility builds an executable from source code and libraries using a Makefile, Apache Ant builds a Java project from its source code and libraries by using a similar XML file.
If you would like to install Apache Ant on CentOS, follow this guideline.
First of all, you need to install Java Development Kit, since Apache Ant will use JDK during its build process.
Then go ahead and install Apache Ant, using its binary distribution from the official Apache web site.
$ sudo tar xvfvz apache-ant-1.9.2-bin.tar.gz -C /opt
$ sudo ln -s /opt/apache-ant-1.9.2 /opt/ant
You then have to set up ANT_HOME environment variable, and include Ant binary in your path, as follows.
$ sudo ln -s /opt/ant/bin/ant /usr/bin/ant
Log out and log back in, to reload the environment variables defined in /etc/environment.
Finally, verify that Apache Ant is successfully installed.
Apache Ant(TM) version 1.9.2 compiled on July 22 2013
Subscribe to Xmodulo
You can have daily Linux tutorials and FAQs delivered to your email inbox. Simply enter your email address below to subscribe to our mailing list. You will receive hands-on guides and carefully written tutorials related to Linux, everything for free.