Re:How to Use the Foreign Function API in Java 22 to Call C ...
by tadfisher on Thursday May 09, 2024 @03:51PM
(#40312275)
Ah, looking through the docs [1]; you have to use your own ClassLoader (so it can be garbage-collected), and statically-link with a JNI library which is unloaded when the ClassLoader is garbage-collected.
1: https://docs.oracle.com/en/java/javase/22/docs/specs/jni/inv...