36.8 Creating Custom Runtimes with jlink

A new tool in JDK 9 is the jlink command—Java’s linker for creating custom runtime images.25 In a custom runtime, you can include just what’s necessary for a given app or set of apps to execute. For example, if you’re creating a runtime for a device that does not support GUIs, you can create a runtime without the corresponding modules that support Swing and JavaFX. In fact, many of this book’s text-only, command-line examples can execute on a runtime that contains only the java.base module.

36.8.1 Listing the JRE’s Modules

With modularization the JRE is a proper subset of the JDK.26 If you run the command: ...

Get Java How to Program, Early Objects, 11th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.