1 | initial version |
The program now works perfectly on the system where the opencv is installed.
java -Dpath.java.library="/home/me" -jar program.jar
The library where opencv is installed has all the so files and links to so files in place and when I do a ldd on the libopencv_java310.so it displays all the associated so files/links are aokay.
However on the machine where opencv is not installed:
I have been able to carry the libs over and create all the links using the ln command however I am still getting java.lang.unsatifiedlinkerror: /my/lib/libopencv_java310.so: libopencv_core.so.3.1: cannot open shared object file: No such file or directory
I did an ldd on libopencv_java310.so and the result is libopencv_core.so.3.1 => not found
The link libopencv_core.so.3.1 is in the directory along with all the other correct link files and their corresponding so files. What am I missing here? I know I need get the libopencv_java310.so to find the links but I don't know how.
2 | No.2 Revision |
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 now works perfectly on the system where the opencv is installed.
java -Dpath.java.library="/home/me" -Djava.library.path="/home/me/OpenCv/opencv-3.1.0/build/lib" -jar program.jar
The 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 where opencv is installed has all the so files and from the ldd opencv_java310.so output and create the links to so files in place and when I do a ldd on the libopencv_java310.so it displays all the associated so files/links are aokay.
However on the machine where opencv is just in case the installation machine does not installed:
I have been able to carry the libs over and create all the links using the ln command however I am still getting java.lang.unsatifiedlinkerror: /my/lib/libopencv_java310.so: libopencv_core.so.3.1: cannot open shared object file: No such file or directory
I did an ldd on libopencv_java310.so and the result is libopencv_core.so.3.1 => not found
The link libopencv_core.so.3.1 is in the directory along with all the other correct link files and their corresponding so files. What am I missing here? I know I need get the libopencv_java310.so to find the links but I don't know how.
any of them.