Ubuntu systems need a Java runtime before they can launch packaged JAR files, vendor server applications, and other programs that ship Java bytecode instead of native binaries. Installing the distribution JRE gives the host a supported java command without adding a separate vendor repository.
The default-jre package is an Ubuntu metapackage that follows the release's supported OpenJDK runtime. On Ubuntu 26.04 LTS, that default resolves to the OpenJDK 25 line, while older supported OpenJDK packages remain available when an application documents a specific major-version requirement.
A runtime is enough to run existing Java applications, but it does not install the javac compiler used to build source code. Server hosts that do not need desktop Java integration can install default-jre-headless instead, and hosts with more than one runtime should verify which java alternative is active before starting the application.
Related: How to install JDK on Ubuntu
Related: How to run a JAR file on Linux
Steps to install Java Runtime Environment (JRE) on Ubuntu:
- Open a terminal with sudo privileges.
- Refresh the APT package index.
$ sudo apt update
- Install the default JRE package.
$ sudo apt install default-jre
Use sudo apt install default-jre-headless on server hosts that only need the command-line runtime and do not need desktop Java integration packages.
- Confirm that the java command is available in the shell path.
$ command -v java /usr/bin/java
- Verify the installed OpenJDK runtime.
$ java --version openjdk 25.0.3 2026-04-21 OpenJDK Runtime Environment (build 25.0.3+9-2-26.04.2-Ubuntu) OpenJDK 64-Bit Server VM (build 25.0.3+9-2-26.04.2-Ubuntu, mixed mode, sharing)
The exact update number changes as Ubuntu publishes security updates. The important result is that java runs and reports the expected OpenJDK major version for the host.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.