The Absence of JRE in Java 11 and the Application of jlink Tool

Nov 23, 2025 · Programming · 27 views · 7.8

Keywords: Java 11 | JRE | jlink | Modularity

Abstract: This article explores the reasons behind the discontinuation of standalone JRE in Java 11, analyzes structural changes in JDK 11, and details how to use the jlink tool to create custom runtime environments. Through code examples and structural comparisons, it helps developers understand application deployment strategies in a modular platform.

Structural Changes in the Java 11 Platform

Starting with Java 11, Oracle no longer provides standalone JRE (Java Runtime Environment) downloads. This change stems from the transition to a modular architecture in the Java platform. In earlier versions like Java 8, the JDK (Java Development Kit) installation typically included a separate JRE directory, such as in Linux at /usr/java/jdk1.8.0_191-amd64/jre or Windows at C:\Program Files\Java\jre1.8.0_181. However, in Java 11, the JDK installation directory only contains components like bin, conf, include, jmods, legal, and lib, with the traditional jre folder missing.

Modular Platform and Custom Runtimes

Java 11 introduces a modular system that allows developers to use the jlink tool to create custom runtime environments containing only the necessary modules. This replaces the previous reliance on a full JRE. For example, if an application only requires the java.base module, developers can run the following command to generate a minimal runtime:

jlink --module-path $JAVA_HOME/jmods --add-modules java.base --output custom-jre

This command extracts the java.base module from the JDK's jmods directory and outputs it to the custom-jre directory. The resulting runtime includes only essential components, significantly reducing deployment size.

Advanced Applications of the jlink Tool

For complex applications, jlink supports adding multiple modules and custom configurations. For instance, a GUI-based application might need the java.desktop module:

jlink --module-path $JAVA_HOME/jmods --add-modules java.base,java.desktop --output minimal-jre

Developers can also create custom launchers using the --launcher parameter:

jlink --module-path $JAVA_HOME/jmods --add-modules my.app.module --launcher myapp=my.app.module/my.app.Main --output app-runtime

This generates an executable named myapp that directly launches the main class of the specified module.

Deployment Strategies and User Impact

End-users do not need to install the full JDK to run Java 11 applications. Instead, developers should use jlink to build custom runtimes and bundle them with the application for distribution. This reduces dependency complexity on the user side while optimizing resource usage. For example, in Windows systems, traditional JRE paths like C:\Program Files\Java\jre1.8.0_181 are no longer applicable; they are replaced by application-specific runtime directories.

Conclusion

The modular design of Java 11 promotes personalized runtime environments. Through the jlink tool, developers can create efficient, lightweight custom JREs tailored to specific application needs. This shift emphasizes modular thinking in modern Java development, enhancing deployment flexibility and performance.

Copyright Notice: All rights in this article are reserved by the operators of DevGex. Reasonable sharing and citation are welcome; any reproduction, excerpting, or re-publication without prior permission is prohibited.