How to install JDK 11 under Ubuntu?

Dmitriy Dumanskiy picture Dmitriy Dumanskiy · Sep 25, 2018 · Viewed 125k times · Source

So Java 11 is out. Does anybody know how to install it (OpenJDK from Oracle) from the command line?

I would like to see something like it was before for Oracle Java 10:

sudo add-apt-repository ppa:linuxuprising/java
sudo apt-get update
sudo apt-get install oracle-java10-installer

P. S. In the similar question proposed instruction:

sudo apt-get install openjdk-11-jdk

doesn't work.

Answer

9ilsdx 9rvj 0lo picture 9ilsdx 9rvj 0lo · Oct 23, 2018

Now it is possible to install openjdk-11 this way:

sudo apt-get install openjdk-11-jdk

(Previously it installed openjdk-10, but not anymore)