Member-only story
1. Prerequisite
The current version of Apache Ant is 1.10.x which requires Java 1.10 at minimum. Therefore, you should make sure you have suitable Java installed on your environment.
2. Install Apache Ant on Ubuntu manually
Download Ant
You can download Ant distribution from the Apache Ant website. Currently, the latest release of Ant is version 1.10.x.
In the following command, I will download the binary only version of Ant:
wget http://mirror.its.dal.ca/apache//ant/binaries/apache-ant-1.10.3-bin.tar.gz
replace the http URL with the latest ant version URL.
sudo tar -xf apache-ant-1.10.3-bin.tar.gz -C /usr/local
The above command will unpack the Ant distribution to /usr/local/apache-ant-1.10.3
You can also extract the zip file manually and copy it to the /usr/local/ location.
Next, we will create a symbolic link to the Ant distribution:
sudo ln -s /usr/local/apache-ant-1.10.3/ /usr/local/ant
Create ANT_HOME Environment Variables
Create a ant.sh file at /etc/profile.d folder (you can use vi with below command)
sudo vim /etc/profile.d/ant.sh