RFR: 8346719: Add relaunchers to the static JDK image for missing executables [v6]
Magnus Ihse Bursie
ihse at openjdk.org
Thu Sep 11 09:30:53 UTC 2025
On Wed, 10 Sep 2025 23:29:03 GMT, Jiangli Zhou <jiangli at openjdk.org> wrote:
>> Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Update based on review
>
> src/java.base/share/native/launcher/main.c line 41:
>
>> 39:
>> 40: // This is reported when requesting a full version
>> 41: static char* launcher = LAUNCHER_NAME;
>
> Is it guaranteed that `LAUNCHER_NAME` is always defined at build time? Is it safer to keep the `ifdef LAUNCHER_NAME` check and initialize `launcer` to `NULL` if `LAUNCHER_NAME` is not defined? From removed defines.h:
>
>
> #ifdef LAUNCHER_NAME
> static const char* const_launcher = LAUNCHER_NAME;
> #else /* LAUNCHER_NAME */
> static char* const_launcher = NULL;
> #endif /* LAUNCHER_NAME */
Yes, it is guaranteed. It is always passed by the make files, and have been for a very long time. That ifdef has not been needed since the "new" build system, so maybe it was needed in JDK 7 or prior...
> src/java.base/windows/native/launcher/relauncher.c line 1:
>
>> 1: /*
>
> How did you test the relauncher for Windows? Can you remind me if static JDK is support for Windows?
Yes, static JDK is supported on all supported platforms.
I just ran simple adhoc tests on the command line, checking that a select subset of the launchers worked, like jar, jlink and javac. My assumption was that if they just started fine, then there were no reason to test the full functionality, since this patch is just about getting them launched.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24380#discussion_r2339724736
PR Review Comment: https://git.openjdk.org/jdk/pull/24380#discussion_r2339737476
More information about the core-libs-dev
mailing list