How to install Oracle Java 15 on Ubuntu, Debian or Linux Mint using APT PPA repository

Oracle has released Java 15 a few days ago. Those who want to install this program in Ubuntu, Debian and Linux-based distributions (such as Pop!_OS, Linux Mint, Zorin OS, etc.) can use Linux Uprising Java PPA. Oracle JDK 15 will receive at least two quarterly updates, and then JDK16 will be released in March 2021.To learn about the new features of Oracle Java 15, see Announce. I want to point out that I do not recommend Oracle Java, but I provide it to users who need it. Oracle Java uses a commercial license starting from Java 11. The license only allows free download and use of it for development and testing, but you need to pay to use it in production.You can use the open source JDK build instead of Oracle Java, for example Adopt OpenJDK Or Zulu OpenJDK.

The Oracle Java 15 installer is based on the Web Upd8 Java package (so the credit goes to its original creator) with minor modifications and does not contain any Oracle Java binaries. Instead, it will automatically download on your system, install Oracle Java 15 and set it as the default Java (run update alternatives, export JAVA_HOME environment variable, etc.). For Oracle Java 15, there are x64 and aarch64 Linux builds available. Starting with the latest Oracle Java 15, Oracle has stopped providing many versions of ARM builds. This is the first time Oracle has released ARM binaries since I took over the package, so if you encounter ARM-related issues, please let me know. package.

Use the APT PPA repository on Ubuntu, Debian, Linux Mint, Pop! Install Oracle Java 15 on _OS, Zorin OS and other operating systems

The software package in this PPA downloads and installs Oracle Java 15 for you (with an application menu/”open with” entry).If you choose to set this Java version as the default version (by installing oracle-java15-set-default Package), the package will update the alternative method to set all Java binaries in the package as default values ​​and export the JAVA_HOME environment variable for this Java version (requires logout/relogin to take effect) Oracle provides its own DEB packages for download, but they only copy Oracle Java 15 files to your system, nothing more. It is not allowed to set it as the default Java, not to set the JAVA_HOME environment variable, not to create a menu item, etc. Ubuntu, Linux Mint, Pop! _OS and other Ubuntu-based Linux distributions: Open a terminal and use the following command to add Linux Uprising Oracle Java PPA and install Oracle Java 15 (Oracle JDK 15) only for x64/aarch64:

sudo add-apt-repository ppa:linuxuprising/java
sudo apt update
sudo apt install oracle-java15-installer

Debian and other Linux distributions based on Debian instead of Ubuntu (no add-apt-repository User: Open the terminal and run the following commands to add the Linux Uprising Oracle Java PPA repository and install Oracle JDK 15:

su -

echo "deb http://ppa.launchpad.net/linuxuprising/java/ubuntu focal main" | tee /etc/apt/sources.list.d/linuxuprising-java.list

apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 73C3DB2A

apt-get update

apt-get install oracle-java15-installer

exit

This will install Oracle Java 15, and on Linux distributions (such as Ubuntu) that automatically install recommended packages, will also install oracle-java15-set-default Software package, making Oracle Java 15 the default Java version on the system.If you want to skip the installation oracle-java15-set-default like this:

sudo apt install --no-install-recommends oracle-java15-installer

Or, for Linux distributions where the recommended software package is not installed by default, and you want to set this Oracle Java 15 as the default version of the system, please install it manually oracle-java15-set-default package:

sudo apt install oracle-java15-set-default

If you don’t want Oracle Java 15 to be the default Java version on your system, please delete oracle-java15-set-default use:

sudo apt remove oracle-java15-set-default

You can check the default Java version on the system by opening a terminal and entering the following command: java -version and / or javac -version. Examples in my system:

$ java -version
java version "15" 2020-09-15
Java(TM) SE Runtime Environment (build 15+36-1562)
Java HotSpot(TM) 64-Bit Server VM (build 15+36-1562, mixed mode, sharing)

$ javac -version
javac 15

You might also like: How to use SDKMAN to install/switch between multiple Java versions

How to automatically accept Oracle Java 15 license

Downloading and installing Oracle Java 15 requires users to accept the license. In some cases, such as when using it in an automated script, you may want to use a command to automatically accept the license. You can do this using the following methods:

echo oracle-java15-installer shared/accepted-oracle-license-v1-2 select true | sudo /usr/bin/debconf-set-selections

If that doesn’t work, try the following command:

echo oracle-java15-installer shared/accepted-oracle-licence-v1-2 boolean true | sudo /usr/bin/debconf-set-selections

What to do if the download fails

What if the Oracle Java 15 installer fails to download Oracle Java? This can happen if you are behind some firewall, router or proxy and prevent the installer from downloading Oracle Java archive files. However, there are solutions for this situation.You can download the Oracle Java 15. /var/cache/oracle-jdk15-installer (If the folder does not exist, please create it as the root user), then install oracle-java15-installer As mentioned above, obtain the software package from the Linux Uprising PPA. The installer will try to use the local version you downloaded manually instead of trying to download the Oracle Java 15 .tar.gz archive file yourself. Make sure that the Oracle Java 15 .tar.gz and Oracle Java Installer packages downloaded from the PPA are the same version, otherwise it will not work properly. You may also be interested: the new Oracle Java 11 installer for Ubuntu, Debian, or Linux Mint (using local Oracle Java .tar.gz)

Source

Sidebar