Update to latest version of java after ppa is discontinued

I did search for all PPAs on special launchpad page.

And it gave some alternatives like Hellenic Schools Technical Support Team team PPA - they have packages for Ubuntu

  • 12.04 LTS (precise)
  • 14.04 LTS (trusty)
  • 16.04 LTS (xenial)
  • 18.04 LTS (bionic)
  • 19.04 (disco)
  • 19.10 (eoan)
  • 20.04 LTS (focal)

You can add this repository and install Java 8 from it with:

sudo add-apt-repository ppa:ts.sch.gr/ppa
sudo apt-get update
sudo apt-get install oracle-java8-installer

Either install the Ubuntu Developers package maintainer's version in Ubuntu with sudo apt install default-jdk (Ubuntu 18.04 and earlier) or sudo apt install openjdk-13-jdk (Ubuntu 19.04 and later) or follow the below instructions for installing Oracle Java from New Oracle Java 12 Installer For Ubuntu Or Linux Mint (Using Local Oracle Java .tar.gz). Since that tutorial was published the latest Oracle JDK version has been updated from JDK 11 to JDK 12, and I have updated the instructions from the tutorial accordingly.

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

  2. Download Oracle JDK 12 .tar.gz archive. Make sure the Oracle JDK version you're downloading is the same as the oracle-java12-installer package version. e.g. the installer is currently version 12.0.2, so it can be used to install Oracle JDK 12.0.2.

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

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

    sudo mkdir -p /var/cache/oracle-jdk12-installer/
    sudo cp jdk-12.0.2_linux-x64_bin.tar.gz /var/cache/oracle-jdk12-installer/
    
  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 and install the oracle-java12-installer package to set up Oracle Java 12:

    sudo add-apt-repository ppa:linuxuprising/java  
    sudo apt update  
    sudo apt install oracle-java12-installer  
    
  6. This is optional. Use the command below to install oracle-java12-set-default, which makes Oracle JDK 12 default:

    sudo apt install oracle-java12-set-default