On Fri, 18 Sep 2026 13:01:30 GMT, Dušan Bálek <[email protected]> wrote:

>> 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 contain  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.

The module path specified to jlink is `--module-path` is prepended to its 
default module path. I think we should just describe that and not use words 
like "external" as it too different to how we document the module path in the 
other tools, API docs, and JEPs.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/32926#discussion_r4047337534

Reply via email to