In this post, we will learn to download and install Apache Ant tool on Ubuntu Linux machine. Steps to set Ant home variable.
- Ubuntu Linux
- Ant Latest version
- Mozilla Firefox Browser
First things first, check if ant is installed on the machine.
Launch terminal and issue the following command.
We can install ant from the above command. However, we will do a manual download from native packages and install of the tool to a standard location.
Navigate to Ant official website.
Click on the Binary Distributions link under the Download section.
Choose the tar file and download the file on to the machine.
Locate the tar file on the computer and extract the contents.
$ sudo tar -xvf <ant tar file>
Move the ant installation folder to some standard location. In this tutorial, we will use /opt/ant directory path.
Set the ANT_HOME environment variable to point to the ant install folder. For example, in this case
Edit the /etc/profile file and set the variable. Add the bin directory to the PATH.
That’s it. We are done with the Ant install process.
Launch Terminal and issue the following Ant version command.
$ ant -v