How to Install Oracle Java 13 in Ubuntu 18.04, 16.04, 19.04

Oracle Java 13 was released a few weeks ago. Here’s how to easily install it in Ubuntu 14.04, Ubuntu 16.04, Ubuntu 18.04, Linux Mint 18.x, 19.x, and higher.

To check out new features and enhancements in Java 13, see the announcement.

The ‘Linux Uprising’ team has made an installer script that automatically downloads and installs Oracle JDK 13, and sets Java 13 as the default Java version (setting JAVA_HOME, etc.).

1.) Open terminal either via Ctrl+Alt+T keyboard shortcut or by searching for ‘terminal’ from application menu. When it opens, run commands to add the PPA:

sudo add-apt-repository ppa:linuxuprising/java

Type your login password (no asterisk feedback) for sudo prompt and hit Enter to continue.

2.) Then check updates and install the script via 2 commands:

sudo apt-get update

sudo apt-get install oracle-java13-installer

The command will automatically downloads Java 13 source tarball, installs on 64-bit Ubuntu, and also sets it as default.

Check the result via command: java --version

(Optional) You can remove the PPA repository via Software & Updates utility under Other Software tab.

And remove Java 13 if you want via command:

sudo apt-get remove oracle-java13-installer