Skip to content

Install the Java Runtime Environment (JRE) on Ubuntu 22.04

java runtime environment ubuntu 22.04

Java Runtime Environment (JRE) is a collection of software & tools for the development of Java applications. It includes the Java Virtual Machine (JVM), Java platform core classes, and supporting Java platform libraries. In this tutorial, we are installing Ubutnu’s default-jre package. Let’s

Note: The JRE is the connector between Java programs and the Operating System.

Prerequisites:

  • Ubuntu 22.04 installed on your system
  • Internet connection to download the necessary files
  • sudo privilege user
How do I install java runtime environment ubuntu 22.04 | 20.04 | 18.04?

Let’s begin the installation of the java runtime environment on ubuntu linux step-by-step:

Step 1: Update the ubuntu system:

To update the ubuntu system open the terminal by pressing “Ctrl + Alt + T” and run this command:

sudo apt update 
sudo apt upgrade -y
install java runtime environment ubuntu 22.04

Step 2: Installing the OpenJDK JRE on ubuntu 22.04:

We are using default-jre install ubuntu for this, and run the following command in your terminal:

sudo apt-get install default-jre

this command will install the latest version of OpenJDK-17-JRE install ubuntu.

How to install OpenJDK-JRE headless ubuntu 22.04 | 20.04 | 18.04?

Basically, the JRE headless version is for low-end devices like embedded devices. You can install the OpenJDK-JRE headless version in your ubuntu by executing this command.

sudo apt install default-jre-headless -y

Step 3: Verify the JRE install ubuntu 22.04:

We can check the installation of jre installation on Ubuntu:

java -version

Uninstallation

How to uninstall OpenJDK-JRE on ubuntu 22.04 | 20.04 | 18.04?

Open the terminal and run the command

sudo apt-get remove default-jre

It will remove ubuntu’s default jre package from your ubuntu system.

The Short Note:

This tutorial is also for any other packages which are dependent on JRE. [like LibreOffice or OpenOffice]. Or, If you facing any errors that are related to jre. ( LibreOffice requires a java runtime environment ubuntu)

Java Runtime Environment (JRE) is an important component for running Java-based applications. With the above commands and steps, you should now be able to install and use JRE to run Java applications on your system. Let me know if you facing any issues.

Thanks!

Related blog: How to reinstall a package using apt-get?

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *