How to install JDK 11 under Ubuntu?

Dmitriy Dumanskiy :

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.

9ilsdx 9rvj 0lo :
sudo apt-get install openjdk-11-jdk

do work, only it installs OpenJDK 10 (very intuitive, isn't it).

This package, sometimes, in undefined future, will became OpenJDK 11 (at least it's speculated to).

If you want to install OpenJDK 11, you need first to add OpenJDK's PPA, and then install the package:

sudo add-apt-repository ppa:openjdk-r/ppa \
&& sudo apt-get update -q \
&& sudo apt install -y openjdk-11-jdk

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=34896&siteId=1