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

前端 未结 6 1084
一向
一向 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:55

    While technically correct these answers are missleading. Setting the environment variables PATH on Windows, or LD_LIBRARY_PATH on unix will change where the jvm looks for libraries: What is LD_LIBRARY_PATH and how to use it?

    on linux: export LD_LIBRARY_PATH=/usr/.../ then: java ....

提交回复
热议问题