Ethan Rankin
Ethan Rankin

Reputation: 31

Eclipse Java Unsatisfied link error on OSX

I am using Opencv 3.1.0 with java on Eclipse and trying to run a basic program, however something is wrong with the build path as I am receiving an error. I already added the opencv user library, but when I run something like-

System.loadLibrary( Core.NATIVE_LIBRARY_NAME );
Mat mat = Mat.eye( 3, 3, CvType.CV_8UC1 );
System.out.println( "mat = " + mat.dump() );

I get this error-

Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java310 in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1864)
    at java.lang.Runtime.loadLibrary0(Runtime.java:870)
    at java.lang.System.loadLibrary(System.java:1122)
    at OpenCvTester.main(OpenCvTester.java:7)

I added the opencv library using the .jar file, and I have the opencv lib folder as the native library location. I don't know what the problem is here, please let me know. Thanks so much.

Upvotes: 3

Views: 1244

Answers (1)

Greg
Greg

Reputation: 31

got the same error. The solution for me was very simple but difficult to find since it's specific to OS X.

Inside your

..opencv_path/build/lib/
folder RENAME libopencv_310.so to libopencv_310.dylib

Hope that helps.

Reference - http://www.senwang.me/2016/01/28/Mac-Opencv-3-1-0/

Upvotes: 1

Related Questions