How to Install Java 25 on Debian 13

How to install Java 25 on Debian 13

In this article, we’re going to teach you how to install Java 25 on Debian 13. Java is a high-level, object-oriented programming language. It can run on any platform that supports Java without the need for recompilation. This feature is known as “write once, run anywhere” (WORA). It can also run on the Tomcat application server, which we also covered in our article here. That’s why Java is used to develop a wide range of applications, including web apps, desktop apps, games, mobile apps, and more.

LTS is short for Long-Term-Support. You can find the LTS versions of Java on this link. At the time of writing, Java 25 is the latest LTS version, an ideal choice for running on Debian 13.

Prerequisites

  • A Debian 13 server ready for Java 25 installation
  • User privileges: root or non-root user with sudo privileges

1. Update the system


Before we start to install anything on the server, we need to update the system packages to the latest versions available:

sudo apt update -y && sudo apt upgrade -y

2. Install Java with apt

Java 25 is available to install using the apt package manager. You can simply install Java 25 on your Debian 13 environment by running the command:

# apt install openjdk-25-jdk

Once installed, you can check to verify with the command:

# java --version

You should obtain a similar output.

openjdk 25.0.1 2025-10-21
OpenJDK Runtime Environment (build 25.0.1+8-Debian-1deb13u1)
OpenJDK 64-Bit Server VM (build 25.0.1+8-Debian-1deb13u1, mixed mode, sharing)

3. Set up a Default Java version


If you already have more than one Java version installed, you configure the Default Java version that you want to use using the command update-alternatives:

# update-alternatives --config java

There are three Java versions to choose from in this example. You can choose the version you want to install by entering the number and clicking Enter.

Selection    Path                                            Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-21-openjdk-amd64/bin/java      2111      auto mode
  1            /usr/lib/jvm/java-25-openjdk-amd64/bin/java      2111      manual mode
  2            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      manual mode
Press  to keep the current choice[*], or type selection number.


4. The difference between JRE and JDK.

You may have noticed that some packages are JDK or openjdk, and some are JRE. Let’s find out which package you need.

JDK – Java Development Kit

The Java Development Kit is used by developers. It includes a compiler, a debugger, an archiver, and other tools that are used in Java Development.

JRE – Java Runtime Environment is used if you would like to run Java programs, without the need to compile or debug the code.

Both JDK and JRE include JVM – Java Virtual Machine is a runtime component or interpreter. Java code is first compiled into bytecode by the Java compiler (Javac), rather than being directly translated into platform-specific machine code. The JVM then interprets or compiles this bytecode into machine code that the host machine can understand. Each platform (Windows, Mac, Linux, etc.) has its own JVM implementation that converts bytecode into native instructions for that particular OS.

5. Install Oracle JDK 25 on Debian 13 from Oracle

Open the browser and search for Download JDK 25 or download from the Oracle website:

You can download it  using the following command:

# wget https://download.oracle.com/java/25/latest/jdk-25_linux-x64_bin.deb

Once downloaded, you can verify the checksum with the following command:

# sha256sum jdk-25_linux-x64_bin.deb

You should see an output that looks similar to the one below:

24336f21649fasczxced80aa1edg3t2d2..

Compare the hash value from the above output to the checksum value on the Oracle download page. You can find the SHA256 checksum next to the download link. If they match, the file’s integrity is validated.

You have successfully downloaded the Java JDK 25 file, and now you can install it using the command:

# dpkg -i jdk-25_linux-x64_bin.deb

Check the installed version with:

# java --version
java 25.0.1 2025-10-21 LTS
Java(TM) SE Runtime Environment (build 25.0.1+8-LTS-27)
Java HotSpot(TM) 64-Bit Server VM (build 25.0.1+8-LTS-27, mixed mode, sharing)

You can also find other Java Distributions you can install, for example: Adoptium (Eclipse Temurin), Zulu (Azul Systems), and others. They may require you to add their repositories to install these distributions or download them from their websites.

6. Conclusion

In this article, we cover how to install Java 25 on Debian 13 from various sources, using the apt package manager for Java OpenJDK, and by downloading it from Oracle – specifically, the Oracle JDK. For most users, OpenJDK is sufficient and offers an easy way to install Java 25 JDK. With Java 25 successfully installed, your system is now ready to run and develop modern Java applications.

Of course, you don’t have to install Java 25 on Debian 13 if you have difficulties and you are not familiar with Linux. You can always contact our technical support. You only need to sign up for one of our NVMe Linux VPS plans and submit a support ticket. We are available 24/7 and will take care of your request immediately

Leave a Comment