On Sat, 8 Feb 2025 09:29:48 GMT, Alan Bateman <al...@openjdk.org> wrote:

> Is the JavaVM param passed to JNI_OnLoad usable in static builds? If so then 
> this just needs to be saved, no need to use GetCreatedJavaVMs, right?

Yes, on static JDK, `JNI_OnLoad`'s `JavaVM *` argument behaves the same as on 
regular JDK. It points to the current VM. IIUC, `libExplicitAttach.c` does not 
appear to explicitly test `JNI_GetCreatedJavaVMs`, but only calls it to 
retrieve the VM. Removing the `JNI_GetCreatedJavaVMs` call can result a cleaner 
fix. Thanks for pointing that out.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23500#discussion_r1948363497

Reply via email to