Categories

  • articles

Tags

  • java

Java 11 is a LTS version, so should be the most popular version. I tested the steps below on Ubuntu version 14.04 and 16.04.

Installation

Here I will provide two option the Oracle and OpenJDK version. I would recommend the OpenJDK version just due to simple licensing agreement.

Add the following PPA and install as follow:

sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt update
sudo apt install openjdk-11-jdk

Oracle Java 11

Add the following PPA and install as follow:

sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:linuxuprising/java
sudo apt update
sudo apt install oracle-java11-installer

Switch between Java versions

List all installed version of Java.

update-java-alternatives -l

Selecting new version of Java.

sudo update-java-alternatives -s java-1.11.0-openjdk-amd64