How to Install Oracle Java 12 in Ubuntu 18.04 / 16.04

March 25, 2019 — Leave a comment

Oracle Java 12 was released a few days ago. Now you can easily install it via PPA in Ubuntu 14.04, Ubuntu 16.04, Ubuntu 18.04, Ubuntu 18.10, and higher.

An installer script was create to make installing Oracle Java 12 easy in Ubuntu. It automatically downloads java package from Oracle web server, and installs it on your system. The “Linux Uprising” team PPA maintains the installer script for all current Ubuntu releases.

1. To add the PPA, open terminal either from app launcher or by pressing Ctrl+Alt+T on keyboard. When it opens, run command:

sudo add-apt-repository ppa:linuxuprising/java

Type user password (no asterisk feedback due to security reason) for sudo prompt and hit Enter.

2. Then run commands to install the script to start downloading and installing Java 12 on your Ubuntu:

sudo apt-get update

sudo apt-get install oracle-java12-installer

For Ubuntu 18.04 and higher, skip sudo apt-get update command since it’s done automatically after adding PPA.

3. If you have installed multiple Java versions, install (or remove) oracle-java12-set-default package to set (or not set) Java 12 as default.

sudo apt-get install oracle-java12-set-default

Finally check Java version via java -version:


To remove Oracle Java 12, run command to remove the installer script:

sudo apt-get remove oracle-java12-installer

And go to Software & Updates -> Other Software to remove the PPA repository.

I'm a freelance blogger who started using Ubuntu 5+ years ago and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me on Google Plus or email to

No Comments

Be the first to start the conversation.

Leave a Reply

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>