I had done a cmake on OpenCV linux version and it created all the required shared objects (libraries).
I was even able to call sample OpenCV programs using those libraries, from Java using JNI on my system. It was running.
But when I try to load libhighgui.so.2.0 in the Hadoop Mapper using
System.load("path/to/libhighgui.so.2.0");
I get the error:
UnsatisfiedLinkError:/path/to/libhighgui.so.2.0: libjpeg.so.62: cannot
open shared object file: No such file or directory
Interestingly, CMake on OpenCV did not create this libjpeg.so.
Any help / solution you have?
Thanks in advance..
EDIT: Other libraries are getting loaded successfully and I am using Distributed Cache for distributing the shared libraries.
what does
ldd path/to/libhighgui.so.2.0yield on the command line?Your shared library depends on other shared libraries, and these shared libraries are not available on the standard library path at runtime.
You’ll need to ensure that all the .so’s your library depends on are also on the library path for each cluster node (either a standard system path like /lib, or you’ll need to amend the java.library.path system property to include a non-standard directory – or just push them using the DistributedCache also, as it add the local folder to the library path)