How To Install ant on Rocky Linux 8

In this tutorial we learn how to install ant on Rocky Linux 8. ant is Java build tool

Introduction

In this tutorial we learn how to install ant on Rocky Linux 8.

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 Rocky Linux 8. In this tutorial we discuss both methods but you only need to choose one of method to install ant.

Install ant on Rocky Linux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

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

sudo dnf -y install ant

Install ant on Rocky Linux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

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 Rocky Linux 8

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

sudo dnf remove ant

ant Package Contents on Rocky Linux 8

/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 Rocky Linux 8 using yum and dnf.