On Fri, 18 Sep 2026 10:05:48 GMT, Alan Bateman <[email protected]> wrote:
>> 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`." It is a good idea to start with: A :-separated list of elements, each of which 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. However, I think the subsequent text should emphasize that this option is primarily used to specify modules external to the JDK running jlink, while standard and JDK modules can be obtained from that JDK. I mean something along these lines: Modules external to the JDK running jlink must always be specified on this path. Standard and JDK modules can be obtained from that JDK because the specified module path, if it does not contain java.base, is prepended to the default module path. For cross-platform linking, the specified module path must contain all target-platform modules required to create the image, including java.base. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/32926#discussion_r4046942299
