java.lang.UnsatisfiedLinkError: org.opencv.core.Mat.n_Mat(III)J?

后端 未结 3 658
清酒与你
清酒与你 2021-01-14 12:31

I\'ve been trying to get opencv working inside of our raspberry pi, but I have not been able to get it working at all. I made a new eclipse project, added in the OpenCV libr

3条回答
  •  醉梦人生
    2021-01-14 13:08

    I ran into this issue on Linux, and it took a bit to figure it out. First, to answer TheGuyWhoCodes above there is no java folder in the build folder. This java intro opencv document tells how to do a build on Linux, and it says

    will create a jar containing the Java interface (bin/opencv-244.jar) and a native dynamic library containing Java bindings and all the OpenCV stuff (lib/libopencv_java244.so or bin/Release/opencv_java244.dll respectively)

    So after you do cmake and make, the jar is in the bin folder and the native library is in the lib folder.

    Second, I initially followed this opencv Installation in Linux document to do the Linux build, and it suggests (in step 5) to unset BUILD_EXAMPLES, BUILD_TESTS, BUILD_PERF_TESTS when doing a java build. What I found is unsetting these appears to be the cause of my "java.lang.UnsatisfiedLinkError: org.opencv.core.Mat.n_Mat(III)J"

    Once I did the build based on the first link, and only unset the BUILD_SHARED_LIBS option, I no longer got the UnsatisfiedLinkError and the test worked. I'm yet to play with it enough to figure out which of the things I was unsetting was the cause of the problem, but that should be a simple trial-and-error process for anyone so inclined.

提交回复
热议问题