I am trying to use a C++ compiled library in my Java code. I set java.library.path
to /usr/local/lib/
and I have all the .so
files for the libraries installed there.
However, when I try to run the Java application I see the following:
Native code library failed to load.
java.lang.UnsatisfiedLinkError: /usr/local/lib/libA.so: libB.so.2.4: cannot open shared object file: No such file or directory
However the file seems to be there:
ls /usr/local/lib/libB.so.2.4
lrwxrwxrwx 1 root root 20 Jan 24 16:33 /usr/local/lib/libB.so.2.4 -> libB.so.2.4.5
The symlinked file also exists. Any idea why this library can't be found?