On Mon, 9 Dec 2024 18:24:44 GMT, Severin Gehwolf <sgehw...@openjdk.org> wrote:

>> I meant the use of `jdk.internal.module.ModulePath` can be replaced with 
>> public API in `JLinkBundlerHelper.java`. Sorry for the confusion.
>> 
>> Can test if jlink tool is available as an alternative to importing 
>> `jdk.tools.jlink.internal.LinkableRuntimeImage` from jpackage:
>> 
>> 
>> private static final boolean LINKABLE_RUNTIME = 
>> ToolProvider.findFirst("jlink").isPresent();
>> 
>> 
>> UPD: Oh, this will work only for runtime created from runtime built with 
>> `--enable-linkable-runtime` flag ("root" runtime) and will not work for the 
>> "root" runtime)
>
> private static final boolean LINKABLE_RUNTIME = 
> ToolProvider.findFirst("jlink").isPresent();
> 
> 
> Sorry, this isn't the same. It would always be true. JEP 493 enabled build or 
> not. I can duplicate what `LinkableRuntimeImage.isLinkableRuntime()` [does 
> ](https://github.com/openjdk/jdk/blob/cc628a133e471e7edf07831ff386f0eaf57e9bff/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/LinkableRuntimeImage.java#L54-L61)
>  in order to determine that without the API, but that's not nice either 
> (duplicated code).

Exports from `jdk.jlink` to `jdk.jpackage` are not needed anymore.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22644#discussion_r1887536381

Reply via email to