
Java is one of the most widely used programming languages worldwide. When considering installing Java 25 on Ubuntu 24.04, developers will find an object-oriented, platform-independent language used to build a range of applications, including web and mobile applications, big data solutions, and even software for cars and planes. Java offers a variety of features, including automatic memory management, portability, security, concurrency, and a syntax based on C and C++, making it familiar to developers with experience in those languages. Java uses garbage collection, an automatic memory management process in the Java Virtual Machine (JVM) that reclaims memory occupied by objects that are no longer referenced by the program.
Installing Java 25 on Ubuntu 24.04 is a straightforward process that may take up to 10 minutes, depending on the method used. Let’s get started and learn different ways to install Java 25!
Table of Contents
Prerequisites
- A server running Ubuntu 24.04 or any Linux OS is essential when dealing with Java 25.
- User privileges: root or non-root user with sudo privileges
Update the system
Before we start with the installation, it is recommended to update the system packages to the latest versions available:
sudo apt update -y && sudo apt upgrade -y
Install Java 25 from the Ubuntu 24.04 repository
Installing Java from the default Ubuntu 24 repository is the easiest and fastest way. To check the available Java installation from the repository, simply execute the following command:
java -V
If there are no Java installations, and we assume that you have a clean Ubuntu installation, you should receive output similar to this:
root@host:~# java -V Command 'java' not found, but can be installed with: apt install openjdk-17-jre-headless # version 17.0.16+8~us1-0ubuntu1~24.04.1, or apt install openjdk-21-jre-headless # version 21.0.8+9~us1-0ubuntu1~24.04.1 apt install default-jre # version 2:1.17-75 apt install openjdk-11-jre-headless # version 11.0.28+6-1ubuntu1~24.04.1 apt install openjdk-25-jre-headless # version 25+36-1~24.04.2 apt install openjdk-8-jre-headless # version 8u462-ga~us1-0ubuntu2~24.04.2 apt install openjdk-19-jre-headless # version 19.0.2+7-4 apt install openjdk-20-jre-headless # version 20.0.2+9-1 apt install openjdk-22-jre-headless # version 22~22ea-1
As you can see, the available Java 25 version is openjdk-25-jre-headless, a Java Runtime Environment package that provides the components needed to run Java applications on Ubuntu 24.04. To install Java 25 JRE, execute the following command:
sudo apt install openjdk-25-jre-headless -y
Once, is installed, check the Java version with the command below:
java -version
You should get the following output:
root@host:~# java -version openjdk version "25" 2025-09-16 OpenJDK Runtime Environment (build 25+36-Ubuntu-124.04.2) OpenJDK 64-Bit Server VM (build 25+36-Ubuntu-124.04.2, mixed mode, sharing)
Install Oracle Java 25 from the installation file
Oracle Java 25 is not included in Ubuntu 24.04’s default repository. To install Oracle Java 25, we need to download it from their official website. To do that, first download the .deb file with the command below:
cd /opt wget https://download.oracle.com/java/25/latest/jdk-25_linux-x64_bin.deb
Once downloaded, you can install the .deb file with the following command on your Ubuntu 24.04 system.
sudo apt install ./jdk-25_linux-x64_bin.deb
To check if the installation was successful, execute the following command:
java --version
You should get output similar to this:
root@host:~# 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)
Explaining Java editions
Java comes in three different editions: JRE, JDK, and OpenJDK. In the following heading, we will explain the main differences between these three editions.
JRE, or Java Runtime Environment, provides everything you need to run Java applications: it includes the JVM (Java Virtual Machine), core libraries, and other supporting files. JRE does not include development tools like a Java compiler and debugger.
JDK, or Java Development Kit, is a superset of the JRE: it includes everything the JRE provides, along with development tools (compiler, debugger, archive tools, etc.). JDK is for developers who write, compile, and debug code.
OpenJDK is an open-source implementation of the Java Platform, Standard Edition (Java SE). OpenJDK is a specific open-source implementation of the JDK. It includes the runtime environment plus the development tools, with its own licensing, support, and community-driven model.
That’s it. You successfully installed Java 25 on Ubuntu 24.04 using the default repository and Oracle Java.
Of course, if you have difficulties or are unfamiliar with Linux, you don’t have to install Java 25 on Ubuntu 24.04 yourself. You can always contact our technical support. You only need to sign up for one of our JavaVplans and submit a support ticket. We are available 24/7 and will address your request immediately.
If you liked this post about installing Java 25 on Ubuntu 24.04, please share it with your friends or leave a comment below.