Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install JDK 11 under Ubuntu?

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.

like image 368
Dmitriy Dumanskiy Avatar asked Oct 10 '22 18:10

Dmitriy Dumanskiy


People also ask

How do I install Java 11.0 11 on Ubuntu?

Adding Oracle JDK 11 to the PATH: The Oracle JDK 11 DEB package file installs Oracle JDK 11 in /usr/lib/jvm directory. It is not in the PATH by default. So, we have to manually add it to the PATH of Ubuntu. As you can see, the directory name is jdk-11.0.

How do I install Java JDK on Ubuntu?

Install Java JDK 11 (Ubuntu Default) By default, Ubuntu 20.04 includes the Java 11 JDK. If Java is not installed on your system then use the following command to install the Java JDK. $ sudo apt install default-jdk. or $ sudo apt install openjdk-11-jdk. The above command will install the default version of Java JDK-11 on your system.

What is Oracle JDK 11 on Ubuntu?

The full form of JDK is Java Development Kit. It is used to write and test Java programs. Recently, JDK 11 came out. It is the latest version of JDK LTS (Long Term Support) release. In this article, I will show you how to install Oracle JDK 11 on Ubuntu. I will be using Ubuntu 18.04 LTS for the demonstration.

What version of OpenJDK should I install on Ubuntu?

First check the default-jdk package, good chance it already provide you an OpenJDK >= 11. So starting from Ubuntu 18.04 LTS it should be ok. For Ubuntu 16.04 LTS, only openjdk-8-jdk is provided in the official repos so you need to find it in a ppa:

How do I install only JRE on Ubuntu?

JRE is mostly included in the Java JDK package. So, if you want to install only JRE on your system then using the following command you can install it on Ubuntu 20.04: $ sudo apt install default-jre


2 Answers

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)

like image 414
9ilsdx 9rvj 0lo Avatar answered Oct 19 '22 14:10

9ilsdx 9rvj 0lo


To install Openjdk 11 in Ubuntu, the following commands worked well.

sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt install openjdk-11-jdk
like image 107
kaniyan Avatar answered Oct 19 '22 14:10

kaniyan