Installing Apache Ant on Fedora Server

This tutorial will guide you through the process of installing Apache Ant on a Fedora Server.

Prerequisites

Step 1: Update the System

Before installing Apache Ant, it's always a good practice to update the system to the latest version.

sudo dnf -y update

Step 2: Install Java Development Kit (JDK)

Apache Ant requires Java Development Kit (JDK) to be installed on the system. Check if you have Java installed by running the command:

java --version

If Java is not installed, install it using the following command:

sudo dnf -y install java-devel

Step 3: Download Apache Ant

Navigate to the Apache Ant website at https://ant.apache.org/. Under downloads, find the latest version of Ant and copy the link address.

In the terminal, use the wget command to download Ant to your server:

cd /opt
sudo wget <paste the copied link>

Step 4: Extract the Ant tarball

Once the download is complete, extract the tar file using the following command:

sudo tar -xvf apache-ant-<version>-bin.tar.gz

Step 5: Set up Environment Variables

Now you need to add /opt/apache-ant-/bin to the PATH environment variable. This will enable the system to locate Ant when you run its commands.

Open the /etc/profile file:

sudo nano /etc/profile

Add the following lines at the end of the file:

# Apache Ant
export ANT_HOME=/opt/apache-ant-<version>
export PATH=$PATH:$ANT_HOME/bin

Step 6: Reload the profile and test the installation

Reload the profile for the changes to take effect:

source /etc/profile

Test the installation by running the following command:

ant -version

You should see the Ant version number displayed in the terminal.

Conclusion

Congratulations! You have successfully installed Apache Ant on your Fedora Server. You can now start using Ant to build Java applications.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!