Skip to content

Instantly share code, notes, and snippets.

@kprasad99
Created January 16, 2019 19:39
Show Gist options
  • Save kprasad99/3f069345176f93e2a9c8b741c825b9d5 to your computer and use it in GitHub Desktop.
Save kprasad99/3f069345176f93e2a9c8b741c825b9d5 to your computer and use it in GitHub Desktop.
Install OpenJDK 8/11 on ubuntu 18.04

Install OpenJDK 8/11 in Ubuntu 18.04

Below are the steps to install openjdk 8/11 in ubuntu 18.04. The default jdk shipped in ubuntu 18.04 is JDK-10.

  • Add Java PPA Repository.

    $ sudo add-apt-repository ppa:webupd8team/java
  • Update apt cache.

    $ sudo apt update
  • Now you can install openjdk-8 or openjdk-11 using below command.

    $ sudo apt install openjdk-8-jdk
  • Update Java alternatives.

    $ sudo update-alternatives --install /usr/bin/java java \
    	   /usr/lib/jvm/java-8-openjdk-amd64/bin/java 1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment