Prevent Java from loading library more than once

前端 未结 4 879
猫巷女王i
猫巷女王i 2020-12-15 22:06

I have several classes that use the same JNI library, called \"jni\". In each of those classes, I have a System.loadLibrary() call in the class\'s static initializer:

<
4条回答
  •  温柔的废话
    2020-12-15 23:04

    I'm pretty sure any subsequent calls to load an already loaded library have no effect [citation needed].

    This was verified in the ClassLoader class source code, but I'm still trying to find a good source for this.

提交回复
热议问题