New Oracle Java 11 Installer For Ubuntu, Debian Or Linux Mint (Using Local Oracle Java .tar.gz)

Oracle Java 11 local installer for Ubuntu or Linux Mint

As many of you already know, Oracle Java requires logging in to an Oracle account to download most versions (all except the latest Oracle Java release). A while back I created Oracle Java 11 and 12 installer packages (based on the package by Web Upd8), and a PPA for Ubuntu and Linux Mint.

Since Oracle Java 11 can't be directly downloaded from Oracle anymore, the installer no longer works, so I created a new installer that requires the user to create an Oracle account, download the Oracle Java 11 .tar.gz archive (the same version as the installer), and place the archive in /var/cache/oracle-jdk11-installer-local/. After this, you can install the oracle-java11-installer-local package, and it will set up Oracle Java 11 for you.

[[Edit]] Oracle Java 17 is the latest LTS, and it was released recently. I recommend you install that instead.

Everything else works as before. You can install the oracle-java11-set-default-local package to set Oracle Java 11 as default for example (not only set it as default using a .jinfo file and update-alternatives, but also export the JAVA_HOME environment variable, etc.).

This was the only way I could think of to work around the fact that Oracle now requires users to create an account and login to download most Oracle Java versions. If you can think of a better way, please let me know!

I will delete the old oracle-java11-installer package since it no longer works. I recommend removing it, and using the new oracle-java11-installer-local package. Or better yet, switch from Oracle Java to OpenJDK or some other JDK build, since Oracle now uses a commercial license, and you can only use Java at no cost for development and testing, but it requires a fee to use it in production.

Related:


These are step-by-step instructions for installing Oracle Java 11 using the new "oracle-java11-installer-local" package:

1. Create an Oracle account at https://profile.oracle.com/myprofile/account/create-account.jspx and sign in

2. Download Oracle JDK 11 .tar.gz archive (scroll down to reach the Oracle Java 11 downloads). Make sure the Oracle JDK version you're downloading is the same as the oracle-java11-installer-local package version. Right now, the version in the PPA is 11.0.13.

3. Create a /var/cache/oracle-jdk11-installer-local/ folder, and copy the Oracle JDK 11 .tar.gz to this folder.

For example, create the /var/cache/oracle-jdk11-installer-local/ folder and copy jdk-11.0.3_linux-x64_bin.tar.gz to this folder (from the current directory) using:

sudo mkdir -p /var/cache/oracle-jdk11-installer-local/
sudo cp jdk-11.0.6_linux-x64_bin.tar.gz /var/cache/oracle-jdk11-installer-local/

4. Purge the old oracle-java11-installer package if you had it installed:

sudo apt purge oracle-java11-installer

5. Add the Linux Uprising Java PPA (it works on Ubuntu, Linux Mint, Pop!_OS, elementary OS, and any other Ubuntu based Linux distribution) and install the oracle-java11-installer-local package to set up Oracle Java 11:

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

On Debian, add the PPA and install the oracle-java11-installer-local package using:

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-java11-installer-local

exit

6. This is optional. Use the command below to install oracle-java11-set-default-local, which makes Oracle JDK 11 default:

sudo apt install oracle-java11-set-default-local

On Ubuntu, this package is automatically installed when installing oracle-java11-installer-local, but that's not the case on Linux Mint.

If you don't want Oracle Java 11 to be the default JDK version on your system, remove the package that makes it default, like this:

sudo apt remove oracle-java11-set-default-local