native-lib-loader icon indicating copy to clipboard operation
native-lib-loader copied to clipboard

scijava native loader must be within the same classloader as the consuming class

Open wasabii opened this issue 1 year ago • 1 comments

The JNI specification requires that the classloader of the caller of System.loadLibrary be the same classloader of the class attempting to consume the native methods. Since native-lib-loader tends to be a dependency of other libraries, and it is the mechanism which eventually invokes System.loadLibrary, it must be the case that all classes using native-lib-loader be loaded by the same class loader that loaded it.

wasabii avatar Dec 14 '23 20:12 wasabii

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/issue-with-ikvm-and-native-lib-loader-in-bioformats-in-net/90082/1

imagesc-bot avatar Dec 19 '23 23:12 imagesc-bot