I had a similar problem. My requirement was to load the following library in a windows environment:
System.loadLibrary("ibex-java");
In my case, I had configured the -Djava.library.path=C:\projetos\platform\windows\ibex
to a folder where all required dlls were stored.
C:\projetos\platform\windows\ibex>dir
21/08/2020 14:49 <DIR> .
21/08/2020 14:49 <DIR> ..
21/08/2020 07:47 <DIR> ibex
21/08/2020 14:49 128.108 ibex-java.dll
21/08/2020 14:49 8.554 ibex-java.dll.a
21/08/2020 14:49 6.582.641 ibex.dll
21/08/2020 14:49 5.577.792 ibex.dll.a
21/08/2020 07:47 938.157 libgcc_s_dw2-1.dll
21/08/2020 14:49 6.349.752 libibex.a
21/08/2020 07:47 1.508.122 libstdc++-6.dll
However when I tried to load this library the following error was thrown:
Caused by: java.lang.UnsatisfiedLinkError: C:\platform\windows\ibex\ibex-java.dll: Can't find dependent libraries
As we can see, all dependent dlls are in the same folder of the library path. However, the single line System.loadLibrary("ibex-java");
couldn't automatically load them. One option to solve this problem was to put the library path in the PATH
environment variable of windows, but I didn't like this idea.
In my case I find a better solution, find the DLLs dependencies and load these libraries by-hand. For example:
System.loadLibrary("libgcc_s_dw2-1");
System.loadLibrary("libstdc++-6");
System.loadLibrary("ibex");
System.loadLibrary("ibex-java");