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 http://ppa.launchpad.net/linuxuprising/java/ubuntu focal main" | sudo tee /etc/apt/sources.list.d/linuxuprising-java.list

You will get a screen output similar to this one

deb http://ppa.launchpad.net/linuxuprising/java/ubuntu 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://keyserver.ubuntu.com:80 --recv-keys 73C3DB2A

Output:

Executing: /tmp/apt-key-gpghome.c0JK1d3zDK/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --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.

Conclusion

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.

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

You might also likeRELATED

How to install ExpressJS on Debian 11?

In this post, you will learn how to install ExpressJS on Debian 11. Hello, developer friends and all. If you are just starting in front...

Keep on eye on your bugs by installing bugzilla on Debian 11

Hello, friends. In this post, we continue with the bug tracking that is so important in many work teams. So today we will show...

How to install Mantis bug tracker on Debian 11?

Hello friends. In this post, you will learn how to install Mantis Bug Tracker on Debian 11. Install LAMP on Debian 11 Mantis is a web...