Java

How to install Java 11 on Ubuntu 18.04

In this tutorial, we are going to see how to install Java 11 on Ubuntu 18.04.

Install Java 11 on Ubuntu 18.04:

This installation also applied to install Java on Ubuntu 14.04,16.04,18.04,18.10 versions as well via PPA.

Versions:

  • Ubuntu 18.04 LTS
  • Oracle JDK 11

Step 1: Download the Java package from Oracle Web server and install in your local machine.

Terminal
sudo add-apt-repository ppa:linuxuprising/java
Install Java 11 On ubuntu 1-min

Step 2: Run below command to update the Ubuntu packages and repositories

Terminal
sudo apt-get update
Install Java 11 on ubuntu 2

Step 3: Run the below command to install the script to start downloading and installing Oracle Java 11 on Ubuntu 18.04.

Terminal
sudo apt-get install oracle-java11-installer
Install Java 11 On ubuntu 3

It will prompt you to get confirmation from you to continue the process [Y/n] type Y and hit enter.

Step 4: After you must accept the oracle-java11-installer license. Press Tab to highlight the Ok button and hit enter.

Install Java 11 On Ubuntu 5

Step 5: After this, you must also accept the Oracle technology network license agreement.

Install Java 11 On Ubuntu 6

Step 6: Now you can see the installation progress. Finally, you must see the following log statements saying Done.

Install Java 11 On Ubuntu 4

Step 7: Check the Java version.

Terminal
java -version
Install Java 11 On Ubuntu 7

Uninstalling:

Terminal
sudo apt-get remove oracle-java11-installer

Happy Learning :)

Found a mistake or something out of date? Tell us →

Written by

chandrashekhar

Founder of onlinetutorialspoint.com. Enterprise architect with 15+ years in healthcare technology, designing and running systems on AWS and Azure. Writes about building real things with AI, local AI hardware and cloud certifications.

Keep reading

Ask a question or leave a comment