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
Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!
Latest posts by Dan Nanni (see all)
- How to switch from NetworkManager to systemd-networkd on Linux - August 31, 2015
- How to set up a system status page of your infrastructure - August 25, 2015
- How to configure virtual hosts in Apache HTTP server - August 24, 2015