How To Install ant on Fedora 34

ant is Java build tool

Introduction

In this tutorial we learn how to install ant on Fedora 34.

What is ant

Apache Ant is a Java library and command-line tool whose mission is to drive processes described in build files as targets and extension points dependent upon each other. The main known usage of Ant is the build of Java applications. Ant supplies a number of built-in tasks allowing to compile, assemble, test and run Java applications. Ant can also be used effectively to build non Java applications, for instance C or C++ applications. More generally, Ant can be used to pilot any type of process which can be described in terms of targets and tasks.

We can use yum or dnf to install ant on Fedora 34. In this tutorial we discuss both methods but you only need to choose one of method to install ant.

Install ant on Fedora 34 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install ant using dnf by running the following command:

sudo dnf -y install ant

Install ant on Fedora 34 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install ant using yum by running the following command:

sudo yum -y install ant

How To Uninstall ant on Fedora 34

To uninstall only the ant package we can use the following command:

sudo dnf remove ant

ant Package Contents on Fedora 34

/etc/ant.conf
/etc/ant.d
/usr/bin/ant
/usr/share/ant/bin
/usr/share/ant/bin/ant
/usr/share/ant/bin/antRun
/usr/share/ant/etc
/usr/share/ant/etc/ant-update.xsl
/usr/share/ant/etc/changelog.xsl
/usr/share/ant/etc/common2master.xsl
/usr/share/ant/etc/coverage-frames.xsl
/usr/share/ant/etc/log.xsl
/usr/share/ant/etc/mmetrics-frames.xsl
/usr/share/ant/etc/printFailingTests.xsl
/usr/share/ant/etc/tagdiff.xsl
/usr/share/doc/ant
/usr/share/doc/ant/KEYS
/usr/share/doc/ant/README
/usr/share/doc/ant/WHATSNEW
/usr/share/licenses/ant
/usr/share/licenses/ant/LICENSE
/usr/share/licenses/ant/NOTICE
/usr/share/man/man1/ant.1.gz

References

Summary

In this tutorial we learn how to install ant on Fedora 34 using yum and dnf.