Installing Apache Ant on Fedora Server
This tutorial will guide you through the process of installing Apache Ant on a Fedora Server.
Prerequisites
- A running instance of Fedora Server
- Basic knowledge of the command line interface
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-
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.