New Oracle Java 11 installer for Ubuntu, Debian or Linux Mint (use native Oracle Java .tar.gz)

As we all know, Oracle Java needs to log in to an Oracle account to download most versions (all versions except the latest Oracle Java version). Not long ago, I created Oracle Java 11 and 12 installer packages (Web Upd8-based packages), and PPA for Ubuntu and Linux Mint. Since it is no longer possible to download Oracle Java 11 directly from Oracle, the installer no longer works, so I created a new installer, asked the user to create an Oracle account, and then downloaded the Oracle Java 11 .tar.gz archive file (same version) As an installer) and then put the archive file in /var/cache/oracle-jdk11-installer-local/. After that, you can install oracle-java11-installer-local Package, it will set up Oracle Java 11 for you.
Everything else works as before. You can install oracle-java11-set-default-local Package, for example, setting Oracle Java 11 as default (not only using .jinfo file and update-alternatives to set it as default, but also exporting JAVA_HOME environment variable, etc.).
This is the only way I can think of to solve the fact that Oracle now requires users to create an account and log in 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 because it no longer works. I suggest to delete it and use the new oracle-java11-installer-local package. Even better, switch from Oracle Java to OpenJDK or other JDK builds, because Oracle now uses a commercial license and you can only use Java for development and testing for free, but using Java in production requires payment.

  • Build with Zulu OpenJDK on Ubuntu, Debian or RHEL Install the latest OpenJDK 12, 11 or 8
  • How to install Oracle Java 14 (JDK14) on Ubuntu, Debian or Linux Mint from APT PPA repository

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

1. Create an Oracle account in the following location And log in
2. download Oracle JDK 11 .tar.gz archive. Make sure the version of Oracle JDK you downloaded is oracle-java11-installer-local software package Version. E.g. The current version of the installer is 11.0.6, so it can be used to install Oracle JDK 11.0.6.
3. Create a /var/cache/oracle-jdk11-installer-local/ Folder, then copy Oracle JDK 11 .tar.gz to this folder
For example, create /var/cache/oracle-jdk11-installer-local/ Folder, then copy jdk-11.0.3_linux-x64_bin.tar.gz to this folder (from the current directory) using the following command:

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. Remove the old oracle-java11-installer Package (if installed):

sudo apt purge oracle-java11-installer

5. Add Linux Uprising Java PPA (available on Ubuntu, Linux Mint, Pop! _OS, basic OS and any other Ubuntu-based Linux distribution) and install 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 PPA and install oracle-java11-installer-local Package use:

su -

echo "deb focal main" | tee /etc/apt/sources.list.d/linuxuprising-java.list

apt-key adv --keyserver hkp:// --recv-keys 73C3DB2A

apt-get update

apt-get install oracle-java11-installer-local


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

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

On Ubuntu, this package is automatically installed during installation oracle-java11-installer-local, But Linux Mint is not.
If you do not want Oracle Java 11 to be the default JDK version on the system, delete the package that makes it the default, as shown below:

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