Java: load shared libraries with dependencies

前端 未结 6 1856
别那么骄傲
别那么骄傲 2021-02-14 16:43

I am wrapping a shared library (written in C) with Java using JNA. The shared library is written internally, but that library uses functions from another external library, which

6条回答
  •  独厮守ぢ
    2021-02-14 17:26

    As described at http://www.owsiak.org/?p=3640, an easy but crude solution on Linux is to use LD_PRELOAD.

    If that's not acceptable, then I'd recommend the answer by Oo.oO: dlopen the library with RTLD_GLOBAL within JNI code.

提交回复
热议问题