1

I've installed in Ubuntu bionic the following package in a 64 bits system:

apt install openjdk-11-jdk

Now I try the new java:

/usr/lib/jvm/java-11-openjdk-amd64/bin/java -version
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4, mixed mode)

The question is why I'm getting Java 10 instead of 11.

With this command, I see that no other java is installed in my system:

# update-alternatives --config java

2 Answers2

1

If you want to install OpenJDK 11, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt install openjdk-11-jdk

Source:1.

Mitch
  • 107,631
1

Here is an explanation of the confusing name of the package.

The Ubuntu Foundation Team made an SRU exception for OpenJDK. Although version 10 is a non-LTS release, they've packaged it as openjdk-11-jdk until OpenJDK 11 goes GA. This choice was based on that assumption that there is a much smaller interface delta between releases 10 and 11 than it would be between 8 and 11.

That's a fairly good reasoning and perhaps an apt-get upgrade wouldn't screw things up that badly when OpenJDK's version gets bumped up from 10 to 11.