Ask Your Question

Revision history [back]

The answer is the Opencv libraries need to be stored on the installation machine in exactly the same directories as the production machine. In my case, I may have not used the right directories during my initial installation on the production machine - storing the opencv libraries in my workspace.

First, I created the same directories on the installation PC /home/me/OpenCV/opencv-3.1.0/build/lib and copied all the opencv libraries from the production machine into that directory.

Second, I used ldd /home/me/opencv_java310.so to find the libraries with missing links.

Third, I used ln -s library.file library.link name to create each link as named in the ldd output.

Fourth, I had to copy over and create links for some libraries stored in the system area /usr/lib and /usr/lib/x86_64-linux-gnu that were also highlighted as missing in the ldd output from opencv_java310.so

Finally, I was able to execute the program java -Djava.library.path="/home/me/OpenCv/opencv-3.1.0/build/lib" -jar program.jar

My next step will be to automate this process with either a shell or some other utility and zip files to contain all the data. I suspect that I should carry ALL the library files from the ldd opencv_java310.so output and create the links just in case the installation machine does not have any of them.