Linux Mint

How to Install Java Runtime on Linux Mint 21

Java Runtime Environment (JRE) is a program that is required to run Java based applications. JRE communicates between the Java and OS of the device. In this tutorial, we will show you how to install the JRE package on Linux Mint 21.

How to Install Java Runtime Environment (JRE) Linux Mint 21

JRE is the prerequisite to execute Java programs on any system. You can run any Java program with JRE. However, it cannot be used for development purposes and can be installed with JDK.

JRE is available in the default repository of Linux Mint. You can install it on Linux Mint 21 via the below-mentioned command:

$ sudo apt install default-jre

This will install the latest version of JRE. To see if the java runtime environment is installed correctly check its version using:

$ java --version

Execute the following command to remove Java Runtime from Linux Mint 21 if you installed it through apt:

$ sudo apt remove --autoremove default-jre -y

How to Install Specific Version of Java Runtime Environment (JRE) Linux Mint 21

To install a specific version of JRE use the command syntax mentioned below:

$ sudo apt install openjdk-<version-number>-jre

For instance, if you want to install JRE version 8, replace <version-number> with 8:

$ sudo apt install openjdk-8-jre

Conclusion 

JRE is used to run Java files; as an end user, you want to use Java on Linux, and for that, you will need JRE. Through this tutorial, you will be able to install JRE on your systems. Moreover, we have also shared the command to remove the JRE from your device.

About the author

Zainab Rehman

I'm an author by profession. My interest in the internet world motivates me to write for Linux Hint and I'm here to share my knowledge with others.