DEV Community

logix2
logix2

Posted on

Installing Oracle Java 15 On Ubuntu / Linux Mint via PPA

If you must use Oracle Java on Ubuntu and Ubuntu-based Linux distributions (Linux Mint, Zorin OS, Pop OS, etc.), and can't use something like OpenJDK, here's how to install it easily, set it as the default Java version, and set the JAVA_HOME environment variable, among others.

Oracle does provide its JDK in a DEB package, but it's useless. All the DEB does is copy the files to /usr/lib/jvm.

Using this PPA, maintained by Linux Uprising, you can make Oracle Java 15 the default Java version on your system (which also exports JAVA_HOME), associate .jar files with Oracle JDK, have applications menu entries (and context menu entries in the file manager) for the various tools available in the JDK, tweaks the Java fonts, installs Java man pages, and more.

The PPA packages don't have any Oracle Java binaries, as that's not allowed by the Oracle Java license. Instead, the package automatically downloads Oracle Java and sets up everything for you.

Add the PPA and install Oracle Java 15 on Ubuntu and Ubuntu-based Linux distributions using:

sudo add-apt-repository ppa:linuxuprising/java
sudo apt update
sudo apt install oracle-java15-installer
Enter fullscreen mode Exit fullscreen mode

On Ubuntu-based Linux distributions that automatically install recommended dependencies, Oracle Java 15 will be made the default Java on the system when installing oracle-java15-installer. If you don't want it to be default, remove the automatically installed recommended dependency oracle-java15-set-default:

sudo apt remove oracle-java15-set-default
Enter fullscreen mode Exit fullscreen mode

Or, if your Ubuntu-based Linux distribution doesn't automatically install recommended packages (Linux Mint used to do this), and you want to make Oracle JDK 15 default, install this package:

sudo apt install oracle-java15-set-default
Enter fullscreen mode Exit fullscreen mode

Latest comments (0)