How To Install jna on Fedora 34

jna is Pure Java access to native libraries

Introduction

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

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 Fedora 34. In this tutorial we discuss both methods but you only need to choose one of method to install jna.

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

sudo dnf -y install jna

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

sudo yum -y install jna

How To Uninstall jna on Fedora 34

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

sudo dnf remove jna

jna Package Contents on Fedora 34

/usr/lib/.build-id
/usr/lib/.build-id/c5
/usr/lib/.build-id/c5/ec41fcbfe6ad5874d939fdf46c58b804f092bd
/usr/lib/java/jna
/usr/lib/java/jna.jar
/usr/lib/java/jna/jna.jar
/usr/lib64/jna
/usr/lib64/jna/libjnidispatch.so
/usr/share/doc/jna
/usr/share/doc/jna/CHANGES.md
/usr/share/doc/jna/OTHERS
/usr/share/doc/jna/README.md
/usr/share/doc/jna/TODO
/usr/share/java/jna.jar
/usr/share/java/jna.pom
/usr/share/licenses/jna
/usr/share/licenses/jna/AL2.0
/usr/share/licenses/jna/LGPL2.1
/usr/share/licenses/jna/LICENSE
/usr/share/maven-metadata/jna.xml
/usr/share/maven-poms/jna
/usr/share/maven-poms/jna.pom
/usr/share/maven-poms/jna/jna.pom

References

Summary

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