How to influence search path of System.loadLibrary() through Java code?

前端 未结 6 1080
一向
一向 2021-02-04 03:18

In a Java project, I am using a third-party library that loads some native library via

System.loadLibrary(\"libName\");

I\'d like to be able to

6条回答
  •  攒了一身酷
    2021-02-04 03:57

    I tried to following to load a native Growl library for a Java application on my Mac where the lib is in the root of the classpath of my application:

    System.load(GrowlUtils.class.getResource("/libgrowl.jnilib").getFile().toString());
    

提交回复
热议问题