On Fri, 18 Sep 2026 07:34:53 GMT, Dušan Bálek <[email protected]> wrote:
>>> Even without JEP 493, there is no guarantee that the run-time image was >>> created with `--keep-packaged-modules` so it may not contain the packaged >>> modules. >>> >>> The other thing we need to get across in the description is that the >>> "default module path" is appended to the path specified to `--module-path`. >>> I need only specify the location of my modules, jlink will find the >>> dpeendences in the run-time image if possible. That might be using the >>> packaged modules or the run-time image itself. >> >> So, in this case, my earlier thought "why mention jmods at all?" seems to >> make even more sense, no? > > So something like this ? > > If this option is not specified, or if the specified module path does not > contain > java.base, required JDK modules are obtained from the current JDK. Modules > external to the current JDK must always be specified on this path. It might be simpler to have it start with the same text as the equivalent option in the java launcher, e.g. A ":"-separated list of elements, each element is a file path to a module or a directory containing modules. Each module is either a modular JAR file, a JMOD file, or an exploded-module directory. We can improve on this of course but keeping it familiar might help. The appending of the default module path is harder to word, here's a suggestion: When creating a run-time image for the current platform, the specified module path is prepended to the default module path. The default module path contains the standard and JDK modules for the JDK running `jlink`. This allows `jlink` to find `java.base` and other modules without specifying their locations to the `--module-path` option. If the `--module-path` option is not specified, then only the default module path is used. When creating a run-time image for a different platform (cross-linking), the specified module path must contains all modules required for the target platform, including `java.base`." ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/32926#discussion_r4045763636
