Red Hat-family 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 OpenJDK runtime gives the host a supported java command managed by DNF and normal operating system updates.
Red Hat packages runtime-only OpenJDK builds as versioned packages such as java-25-openjdk-headless. The headless package is the smaller choice for server and terminal-launched applications, while java-25-openjdk adds desktop Java integration for graphical applications that need it.
The available major version depends on the RHEL, CentOS Stream, or Fedora release and the enabled repositories. Search the repository first, install the runtime package required by the application, and verify java -version before starting the application. A JRE runs existing Java applications but does not install the javac compiler; install the JDK when source compilation is required.
$ dnf search openjdk ##### snipped ##### java-21-openjdk.aarch64 : OpenJDK 21 Runtime Environment java-21-openjdk-headless.aarch64 : OpenJDK 21 Headless Runtime Environment java-25-openjdk.aarch64 : OpenJDK 25 Runtime Environment java-25-openjdk-headless.aarch64 : OpenJDK 25 Headless Runtime Environment ##### snipped #####
The architecture suffix varies by host. Use java-25-openjdk-headless for server and command-line applications, use java-25-openjdk when a desktop Java application needs graphical runtime libraries, and choose an older supported major version only when the application requires it.
$ sudo dnf install --assumeyes java-25-openjdk-headless Dependencies resolved. ========================================================================================== Package Arch Version Repository Size ========================================================================================== Installing: java-25-openjdk-headless aarch64 1:25.0.3.0.9-1.el9 ubi-9-appstream-rpms 60 M Installing dependencies: alsa-lib aarch64 1.2.15.3-1.el9 ubi-9-appstream-rpms 531 k java-25-openjdk-crypto-adapter aarch64 1:25.0.3.0.9-1.el9 ubi-9-appstream-rpms 57 k tzdata-java noarch 2026b-1.el9 ubi-9-appstream-rpms 230 k ##### snipped ##### Transaction Summary ========================================================================================== Install 14 Packages Total download size: 63 M Installed size: 259 M ##### snipped ##### Complete!
RHEL hosts normally need an enabled AppStream repository and a valid subscription. CentOS Stream and Fedora hosts use their enabled DNF repositories for the same package names.
$ java -version openjdk version "25.0.3" 2026-04-21 LTS OpenJDK Runtime Environment (Red_Hat-25.0.3.0.9-1) (build 25.0.3+9-LTS) OpenJDK 64-Bit Server VM (Red_Hat-25.0.3.0.9-1) (build 25.0.3+9-LTS, mixed mode, sharing)
The exact update number changes as Red Hat, CentOS Stream, or Fedora publishes security updates. The important result is that java runs and reports the OpenJDK major version expected by the application.
$ rpm -q java-25-openjdk-headless java-25-openjdk-headless-25.0.3.0.9-1.el9.aarch64
$ sudo update-alternatives --config java
Choose the path that matches the required major version, then rerun java -version. Red Hat OpenJDK packages can install multiple major versions side by side.