How To Install jna on CentOS 7

In this tutorial we learn how to install jna on CentOS 7. jna is Pure Java access to native libraries

Introduction

In this tutorial we learn how to install jna on CentOS 7.

What is jna

JNA provides Java programs easy access to native shared libraries (DLLs on Windows) without writing anything but Java code. JNA’s design aims to provide native access in a natural way with a minimum of effort. No boilerplate or generated code is required. While some attention is paid to performance, correctness and ease of use take priority.

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

Install jna on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

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

sudo yum -y install jna

Install jna 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 jna using dnf by running the following command:

sudo dnf -y install jna

How To Uninstall jna on CentOS 7

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

sudo dnf remove jna

References

Summary

In this tutorial we learn how to install jna on CentOS 7 using yum and dnf.