install Apache Ant Ubuntu Linux

Download the file via link "apache-ant-1.9.16-bin.tar.gz"


Extract file

sudo tar -xf apache-ant-1.9.16-bin.tar.gz

Change folder name into ant

sudo mv apache-ant-1.9.16 ant

Move folder ant to /usr/local

sudo mv ant /usr/local

Navigate to folder /usr/local/ant

cd ~/usr/local/ant

Open file ant.sh

sudo nano /etc/profile.d/ant.sh or sudo vim /etc/profile.d/ant.sh

Edit content inside file (Ctrl + X => Y => Save all contents)

export ANT_HOME=/usr/local/ant
export PATH=${ANT_HOME}/bin:${PATH}

Activate the environment variables

source /etc/profile

Check version

ant -version

You need to login to do this manipulation!