Apache Ant is a Java library and command-line tool to automate the repetitive tasks and helps to build software. Ant is flexible and does not impose coding conventions. It supplies a number of built-in tasks allowing to compile, assemble, test and run Java applications.

Install Apache Ant 


1) Download Ant   
 
$ wget http://www.us.apache.org/dist/ant/binaries/apache-ant-1.9.2-bin.tar.gz
 
2) Extract using tar command
 
$ sudo tar xvfvz apache-ant-1.9.2-bin.tar.gz -C /opt
 
3) Check files if installed
 
$ sudo ln -s /opt/apache-ant-1.9.2 /opt/ant
 
4) Setup ANT environment variable by creating file called ant.sh under /etc/profile.d/ directory
 
$ vi /etc/profile.d/ant.sh
 
5) Add the following contents
 
#!/bin/bash
ANT_HOME=/opt/ant
PATH=$ANT_HOME/bin:$PATH
export PATH ANT_HOME
export CLASSPATH=.
 
6) Save and close the file. Make it executable using the following command
 
$ chmod +x /etc/profile.d/ant.sh
 
7) Set the environment variables permanently by running the following command
 
$ source /etc/profile.d/ant.sh
 
8) Reboot your system.
 
9) Check the ant version using command
 
$ ant -version
 
10) Done
 
Categories: Apache AntLinux

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Apache Ant

Difference between Maven and Apache Ant

Build tools are programs to manage and automate build process of your application. By build process means compiling source code, linking the packages, bundle them into an executable binary. Maven and Apache Ant are popular build Read more…

Apache Ant

Apache Ant basic tasks

In the previous post, we have learned what is Apache Ant, its features and an example to create simple build file. This post will guide you other basic ant tasks that are frequently used to create Read more…

Apache Ant

Apache Ant : Java Build Tool

Apache Ant is a Java library and command-line tool to automate the repetitive tasks and helps to build software. Ant is flexible and does not impose coding conventions. It supplies a number of built-in tasks allowing Read more…