Skip to content

Instantly share code, notes, and snippets.

@frankmanzhu
Last active March 15, 2017 03:19
Show Gist options
  • Save frankmanzhu/867bb19774a151ab86c67dac1a612357 to your computer and use it in GitHub Desktop.
Save frankmanzhu/867bb19774a151ab86c67dac1a612357 to your computer and use it in GitHub Desktop.

Quick tutorial for beginners how to easily install Oracle Java JDK8 or JDK9 in Ubuntu 16.04 or Linux Mint 18 via PPA.

Webupd8 Team is maintaining a PPA repository with installer scripts for the latest Java 8 and 9, that automatically downloads the Java archive from Oracle website and sets up everything for you.

  1. Add the PPA.

Open terminal (Ctrl+Alt+T) and run the command:

sudo add-apt-repository ppa:webupd8team/java
  1. Update and install the installer script:

Run commands to update system package index and install Java installer script:

sudo apt update; sudo apt install oracle-java8-installer

You may replace oracle-java8-installer with oracle-java9-installer to install Java 9.

While the install process, you have to accept Java license to continue downloading & installing Java binaries.

Oracle Java License

  1. Check the Java version

To check the Java version after installing the package, run command:

javac -version

check out java version

  1. Set Java environment variables

The PPA also contains a package to automatically set Java environment variables, just run command:

sudo apt install oracle-java8-set-default

For Java 9, install the package oracle-java9-set-default instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment