How to Install Apache Ant on OpenSUSE Latest
Apache Ant is a Java-based build tool used for compiling and running Java applications. In this tutorial, we will show you how to install Apache Ant on OpenSUSE Latest.
Step 1: Check Java Installation
Before proceeding with the installation, ensure that you have Java installed on your OpenSUSE Latest operating system. To check if it is installed, use the following command in the terminal:
java -version
If you see the version details of Java, it means it's installed; otherwise, install it first.
Step 2: Download Apache Ant
You can download the latest version of Apache Ant from the official Apache Ant website (https://ant.apache.org/). In this tutorial, we will use version 1.10.11.
Use the following command to download Apache Ant:
wget https://downloads.apache.org/ant/binaries/apache-ant-1.10.11-bin.tar.gz
Step 3: Extract Apache Ant
After the download is complete, extract the downloaded archive file with the following command:
tar -xzvf apache-ant-1.10.11-bin.tar.gz
Step 4: Set Environment Variables
Set the ANT_HOME environment variable to the Apache Ant installation directory (in this example, the directory is /usr/local/apache-ant-1.10.11).
export ANT_HOME=/usr/local/apache-ant-1.10.11
Add the bin directory to your PATH.
export PATH=${PATH}:${ANT_HOME}/bin
Make the changes to ANT_HOME and PATH environment variables permanent by adding them to ~/.bashrc:
echo 'export ANT_HOME=/usr/local/apache-ant-1.10.11' >> ~/.bashrc
echo 'export PATH=${PATH}:${ANT_HOME}/bin' >> ~/.bashrc
Reload Bash to apply the changes to the environment variables:
source ~/.bashrc
Step 5: Verify Installation
To verify the installation, run the following command in the terminal:
ant -version
If the installation was successful, you will see the version details of Apache Ant that you just installed.
Congratulations! You have successfully installed Apache Ant on your OpenSUSE Latest operating system.