Guides 11792 Published by

The passage explains three methods for installing OpenJDK 11 on Ubuntu 20.04—using the official Ubuntu repository, adding a trusted PPA, or manually extracting a tar.gz archive. It outlines step‑by‑step commands for each approach and notes that the repo install offers stability, the PPA provides newer patches at the cost of added trust, and the manual method gives full control but requires self‑managed updates. Additionally, it emphasizes verifying the installation with java -version and cautions about potential incompatibilities when using unofficial PPAs. Finally, it advises readers to choose the method that best matches their update preferences and maintenance comfort level.



How to Install OpenJDK 11 on Ubuntu 20.04 LTS

You’ll get Java 11 up and running on a fresh Ubuntu 20.04 install using three different ways: the official Ubuntu repository, a trusted PPA, or a manual tarball extraction. Pick the method that matches how picky you are about updates and package sources.

Install OpenJDK 11 from the Ubuntu repo

  1. Update your package index – this makes sure apt knows what versions are available.
    sudo apt update
  2. Grab the JDK package. The repository ships a clean, security‑patched build that will stay in sync with Ubuntu’s regular updates.
    sudo apt install openjdk-11-jdk
  3. Verify the installation; java -version should print something like “openjdk version "11.0.x””. This step confirms the binaries are on your $PATH.

Why this works: Ubuntu 20.04 ships OpenJDK 11 as its default Java, so you get a tested stack without extra third‑party code.

Install OpenJDK 11 via a PPA (if you need newer patches)

Some people like to chase the very latest security fixes that land in the upstream builds before Ubuntu rolls them out. The “Linux Uprising” PPA is a popular, well‑maintained source.

  1. Add the PPA – it’s just another apt repository, but be aware you’re trusting external maintainers.
    sudo add-apt-repository ppa:linuxuprising/java
  2. Refresh the index again.
    sudo apt update
  3. Install the JDK from the PPA.
    sudo apt install openjdk-11-jdk

Reality check: I once added a random PPA for a graphics driver, and it pulled in an older libssl that broke my Spring Boot apps. Stick to well‑known PPAs or just use the distro packages unless you have a compelling reason.

Install OpenJDK 11 from the official tar.gz archive

When you need an exact build (maybe for reproducible builds) or want to avoid any package manager, download the binary directly from AdoptOpenJDK/Adoptium.

  1. Grab the latest tarball – replace x.y.z with the current version number.
    wget https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.x.y.z%2Bz/OpenJDK11U-jdk_x64_linux_hotspot_11.x.y.z.tar.gz
  2. Extract it into /opt. This location is conventional for manually managed software.
    sudo tar -xzf OpenJDK11U-jdk_x64_linux_hotspot_11*.tar.gz -C /opt/
  3. Create a symlink so the system can find java without altering your PATH in every shell.
    sudo ln -s /opt/jdk-11*/bin/java /usr/local/bin/java11
  4. Test it:
    java11 -version

Why bother: The archive method gives you full control over which build you run, but you’ll have to manage updates yourself. If you’re comfortable with manual maintenance, this is the cleanest approach.

Pick the route that feels right for your workflow. The repo install is quick and safe; the PPA gives a bit more bleeding‑edge support at the cost of extra trust; the archive method is for the control freaks who love to keep everything in their own hands.