JNI dependent libraries

后端 未结 6 532
小鲜肉
小鲜肉 2020-12-31 03:52

I\'m running a library via JNI (I didn\'t write it), and internally it calls another DLL. I get an error saying \"Can\'t find dependent libraries\" unless I put the path of

6条回答
  •  攒了一身酷
    2020-12-31 04:06

    I was able to get this to work without putting any DLLs on the PATH by using System.load() on all DLLs in reverse dependency order. Just to be clear, I was calling System.load() on all dependent DLLs, not just JNI DLLs. You don't have to call System.load() on DLLs that come with Windows (they're on the PATH).

    I was doing this in a web app where a jar included DLLs that were getting unpacked. Your situation seems simpler, so I believe it should work. I generally followed the solution here: How to make a JAR file that includes DLL files?

提交回复
热议问题