How to install Oracle Java 16 on Ubuntu 20.04, 18.04, 20.10.

Oracle Java 16 was announced as a short release with 6 months of support. To install on Ubuntu 14.04, Ubuntu 16.04, Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10 via PPA:

The new features in this release are:

  • Vector API (incubator)
  • Enable C ++ 14 language features
  • Migrate from Mercurial to Git
  • Migrate to GitHub
  • ZGC: Parallel thread stack processing
  • Unix domain socket channel
  • Alpine Linux port
  • Elastic metaspace
  • Windows / AArch64 port
  • Foreign Linker API (Incubator)
  • Warning about value-based classes
  • Packaging tool
  • External memory access API (third incubator)
  • instanceof pattern matching
  • Record
  • Strongly encapsulates inside the JDK by default
  • Sealed class (second preview)

TheĀ· “Linux Uprising” Team ppa I have created an installer script that automatically downloads and installs the Oracle JDK 16 package and sets Java 16 as the default Java version on 64-bit Ubuntu-based systems (such as setting JAVA_HOME).

1.) Open a terminal and run the command to add the PPA.

sudo add-apt-repository ppa:linuxuprising/java

Enter your user password (without asterisk feedback) when prompted and press Enter to continue.

How to install Oracle Java 16 on Ubuntu 20.04, 18.04, 20.10.

2.) After adding the PPA, update the system package cache and install the script.

sudo apt update

sudo apt install oracle-java16-installer

If you don’t want to set Java 16 as the default, replace the last command with:

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

How to install Oracle Java 16 on Ubuntu 20.04, 18.04, 20.10.

Once the package is installed, you must accept the license (press Tab to highlight it) before starting the download process.

After installing Oracle Java 16 java --version command:

(Optional) To uninstall the PPA repository, run the command in your terminal.

sudo add-apt-repository --remove ppa:linuxuprising/java

If necessary, run the following command to remove Oracle Java 16.

sudo apt-get remove oracle-java16-installer

Share this:

  • More
Sidebar