java.lang.UnsatisfiedLinkError: Native Library XXX.so already loaded in another classloader

前端 未结 4 979
失恋的感觉
失恋的感觉 2020-12-01 18:09

I have deployed one web-application, which contains following code.

System.loadLibrary(org.opencv.core.Core.NATIVE_LIBRARY_NAME);

Now, I de

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-01 19:11

    As of javacpp>=1.3 you may also change the cache folder (defined by system property) in your war deployment listener:

    System.setProperty("org.bytedeco.javacpp.cachedir",
                       Files.createTempDirectory( "javacppnew" ).toString());
    

    Note though that native libraries are always unpacked and will be loaded several times (because considered as different libs).

提交回复
热议问题