How To Install libunsafe-fences-java on Debian 10

Learn how to install libunsafe-fences-java on Debian 10 with this tutorial. libunsafe-fences-java is wrapper library around the Java 8 fences API

Introduction

In this tutorial we learn how to install libunsafe-fences-java on Debian 10.

What is libunsafe-fences-java

libunsafe-fences-java is:

unsafe-fences is a very simple Java library that just provides a shim around the Java 8 Unsafe methods used for memory fencing.

In Java 8, three memory-ordering intrinsics were added to the sun.misc.Unsafe class: fullFence, storeFence, and loadFence.

The main goal of unsafe-fences is to allow code in Java 6 and 7 to compile those calls with a provided boolean guard.

This is especially useful for projects like JRuby that support several JDK versions but it can be reused by other Java projects as well.

There are three methods to install libunsafe-fences-java on Debian 10. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install libunsafe-fences-java Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install libunsafe-fences-java using apt-get by running the following command:

sudo apt-get -y install libunsafe-fences-java

Install libunsafe-fences-java Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install libunsafe-fences-java using apt by running the following command:

sudo apt -y install libunsafe-fences-java

Install libunsafe-fences-java Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install libunsafe-fences-java using aptitude by running the following command:

sudo aptitude -y install libunsafe-fences-java

How To Uninstall libunsafe-fences-java on Debian 10

To uninstall only the libunsafe-fences-java package we can use the following command:

sudo apt-get remove libunsafe-fences-java

Uninstall libunsafe-fences-java And Its Dependencies

To uninstall libunsafe-fences-java and its dependencies that are no longer needed by Debian 10, we can use the command below:

sudo apt-get -y autoremove libunsafe-fences-java

Remove libunsafe-fences-java Configurations and Data

To remove libunsafe-fences-java configuration and data from Debian 10 we can use the following command:

sudo apt-get -y purge libunsafe-fences-java

Remove libunsafe-fences-java configuration, data, and all of its dependencies

We can use the following command to remove libunsafe-fences-java configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge libunsafe-fences-java

Dependencies

libunsafe-fences-java have the following dependencies:

References

Summary

In this tutorial we learn how to install libunsafe-fences-java package on Debian 10 using different package management tools: apt, apt-get and aptitude.