jlink
The JDK tool that links a set of modules and their dependencies into a custom runtime image.
In more detail
jlink takes --module-path, --add-modules for the root modules and --output for a new directory. The image has its own bin/java and contains only the modules needed. Automatic modules cannot be linked.
Example
jlink --module-path mods --add-modules com.acme.app --output runtimeRelated terms
- JMOD file — A packaging format for JDK modules, used by jlink to build runtime images.
- jdeps — The JDK tool that reads compiled classes and reports their package and module dependencies.
- module — A named set of packages with a descriptor, module-info.java, that declares what it requires, exports, opens, uses and provides.
Taught in
- Modules: Exports, Opens And Services — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Jars, Automatic Modules And Runtime Images — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep