Ubuntu

The instructions have been tested on Ubuntu 18.04, 20.04, and 22.04.

Update the package list by running the following command:

sudo apt-get -y update


Please be patient as this process may take 1-2 minutes. Once completed, you will see a command prompt awaiting further input from the user.

Use the universal command to install OpenJDK 11:

sudo apt install -y openjdk-11-jdk

Wait for the download and installation of all necessary files to finish.

Debian

Update the package list by running the following command:

apt-get -y update

Please be patient as this process may take 1-2 minutes. Once completed, you will see a command prompt awaiting further input from the user.

Use the universal command to install OpenJDK 11:

apt-get install -y openjdk-11-jdk


Wait for the download and installation of all necessary files to finish.

Verification of Installation

java -version

Uninstalling Java

apt-get -y purge openjdk* java*