RFR: 8346719: Add relaunchers to the static JDK image for missing executables
Alan Bateman
alanb at openjdk.org
Thu Sep 11 06:35:42 UTC 2025
On Thu, 3 Apr 2025 14:09:58 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> In the static JDK image, a single humongous java executable is generated, and no other launcher, such as javac. This makes it impossible to run our jtreg tests, which assume these are present.
>>
>> The solution is fortunately simply: we just need to add a bunch of trivial launchers, which are thin wrappers that execute the main java binary, with the proper arguments. This will result in the same behavior as the normal dynamic launchers, only that we will need to take the detour of launching another process instead of calling directly into the JLI library.
>
> Right now, the static-jdk image is a bit strange in that it's a modular run-time image but with all native code compiled into bin/java. In time we hope that jlink will be able to create a static image where everything is in the single executable, so no bin directory (or any directory) for launchers. I don't object to doing something to help testing the intermediate step, just not sure that main line is the right place for this.
>
> As regards the shim when I wonder if it should use CreateProcessW but maybe it doesn't matter for the test environments where they will run.
> @AlanBateman @jianglizhou Now that Erik has approved the build functionality, I'd appreciate if anyone of you could approve as well, then I can finally integrate this.
ACK, I'll get to it shortly.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24380#issuecomment-3278424046
More information about the core-libs-dev
mailing list