Menu

INSTALLING ANT ON UBUNTU OR LINUX BOX

August 1, 2014 - ubuntu

Hey I have been asked by some to put a short snippet on how to install Ant on Linux Box. Well the steps are simple.

Step 1  :  Download the Apache Ant e.g (1.7.1) binary distribution from Apache archive from http://archive.apache.org/dist/ant/binaries/

1
$ wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz

Step 2  :  Uncompress the binary distribution and copy it to the /usr/local directory:

1
2
$ tar -zxf apache-ant-1.7.1-bin.tar.gz
$ sudo mv apache-ant-1.7.1 /usr/local

Step 3  : Create symbolic link in /usr/bin:

1
$ sudo ln -s /usr/local/apache-ant-1.7.1/bin/ant /usr/bin/ant

Step 4  : Create ENVIRONMENT Variables

Open up ~/.bashrc and add the below lines

1
2
3
export ANT_HOME=/usr/bin/ant
export ANT_OPTS="-XX:MaxPermSize=900m -Xmx900m"

Step 5 : Append ANT_HOME to PATH

Open up ~/.bashrc and add/append

1
2
PATH=$PATH:$ANT_HOME/bin
export PATH="$PATH"

And that’s it you are done! Save the file.

Run

1
$ ant --version

You should now see ANT version! GO ahead and build your Java Projects 🙂 Cheers.

Leave a Reply