How to Install JDK 25 (Java 25) on Debian 13

4 min readUpdated May 19, 2026

In this guide, we will explain how to install JDK 25 (Java 25) on a server running Debian 13.

#Installing Java on Debian

Debian 13 includes JDK 25 in its repositories by default, so no separate configuration like in Ubuntu is required. Here everything is a bit simpler.

#Step 1. Update the package lists

To do this, use the command below

bash
sudo apt update

In our Debian images, the sudo package is not installed by default. Run the listed commands without sudo - as the root user. If needed, sudo can be installed with the command

Updating the package lists with the apt update command on Debian 13

#Step 2. Installing JDK 25

Next, we will install the JDK 25 package using the command below

bash
apt install openjdk-25-jdk -y

The process takes a couple of minutes on average. This depends on the network speed and server performance.

Installing the openjdk-25-jdk package on Debian 13

#Step 4. Verifying the installation

After the installation is complete, we will check the Java version.

bash
java -version

The output should match the screenshot below. This way you can make sure that Java is installed and fully ready to use

Output of the java -version command with JDK 25 installed

#Removing Java

If you have decided to remove this Java, use the commands below

bash
apt remove --autoremove openjdk-25-jdk

The command below also removes the Java package configuration

bash
apt purge --autoremove openjdk-25-jdk

Did not find the answer? We are online 24/7.Contact support