How to install Oracle Java 17 LTS on Debian 11

Hello, friends. In this post, you will learn how to install Oracle Java 17 on Debian 11.

Oracle Java 17 is the latest LTS version of this popular programming language. Although many people still use version 11, the truth is that this new LTS will be adopted progressively.

As we know, Oracle’s version differs from the OpenJDK in part due to the Linux community and the different treatment between licenses. However, many may find it important to install the Oracle version.

So, in this post, we will help you with the task.

Install Oracle Java 17 on Debian 11

The first thing to do is to open a terminal and make sure that the system is completely up-to-date.

So to complete this, run this pair of commands

sudo apt update
sudo apt upgrade

It is necessary that the gnupg2 package is installed. To do this run.

sudo apt install gnupg2

Then, add the LinuxUprising repository, which contains a package that facilitates the process.

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

You will get a screen output similar to this one

deb focal main

To avoid security issues with the system, add the GPG key from this repository before using it.

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


Executing: /tmp/apt-key-gpghome.c0JK1d3zDK/ --keyserver hkp:// --recv-keys 73C3DB2A
gpg: key EA8CACC073C3DB2A: public key "Launchpad PPA for Linux Uprising" imported
gpg: Total number processed: 1
gpg:               imported: 1

Now refresh APT.

sudo apt update

Then just install the oracle-java17-installer package.

sudo apt install oracle-java17-installer

If you want Oracle Java 17 to become the default version of the system, then add the --install-recommends option leaving the command

sudo apt install oracle-java17-installer --install-recommends

When the package is installed, it will show us the license terms that we must accept. Once we accept them, the download and installation process of Oracle Java 17 will start.

1.- License terms
1.- License terms

To verify the changes, you can run:

java --version

And then:

javac --version
2.- Oracle Java 17 on Debian 11
2.- Oracle Java 17 on Debian 11

Then you will know that Oracle Java 17 is installed on the system and is ready for you to use it.

So enjoy it and start working with it.


Thanks to this post, you have learned how to install Oracle Java 17 LTS on Debian 11. Now you can use it in your projects and other things.

Thanks for reading.

I am Angelo. A systems engineer passionate about Linux and all open-source software. Although here I'm just another member of the family.


Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook