How To Install apache-commons-collections on CentOS 7

In this tutorial we learn how to install apache-commons-collections on CentOS 7. apache-commons-collections is Provides new interfaces, implementations and utilities for Java

Introduction

In this tutorial we learn how to install apache-commons-collections on CentOS 7.

What is apache-commons-collections

The introduction of the Collections API by Sun in JDK 1.2 has been a boon to quick and effective Java programming. Ready access to powerful data structures has accelerated development by reducing the need for custom container classes around each core object. Most Java2 APIs are significantly easier to use because of the Collections API. However, there are certain holes left unfilled by Sun’s implementations, and the Jakarta-Commons Collections Component strives to fulfill them. Among the features of this package are - special-purpose implementations of Lists and Maps for fast access - adapter classes from Java1-style containers (arrays, enumerations) to Java2-style collections. - methods to test or create typical set-theory properties of collections such as union, intersection, and closure.

We can use yum or dnf to install apache-commons-collections on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install apache-commons-collections.

Install apache-commons-collections on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install apache-commons-collections using yum by running the following command:

sudo yum -y install apache-commons-collections

Install apache-commons-collections on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install apache-commons-collections using dnf by running the following command:

sudo dnf -y install apache-commons-collections

How To Uninstall apache-commons-collections on CentOS 7

To uninstall only the apache-commons-collections package we can use the following command:

sudo dnf remove apache-commons-collections

References

Summary

In this tutorial we learn how to install apache-commons-collections on CentOS 7 using yum and dnf.