Java: load a library that depends on other libs

后端 未结 3 810
孤城傲影
孤城傲影 2021-01-01 06:47

I want to load my own native libraries in my java application. Those native libraries depend upon third-party libraries (which may or may not be present when my application

3条回答
  •  没有蜡笔的小新
    2021-01-01 07:23

    See the accepted answer here:

    Changing LD_LIBRARY_PATH at runtime for ctypes

    In other words, what you're trying to do isn't possible. You'll need to launch a new process with an updated LD_LIBRARY_PATH (e.g., use ProcessBuilder and update environment() to concatenate the necessary directory)

提交回复
热议问题