Java linker error when trying out tutorial

asked 2013-07-15 07:37:36 -0600

jiting gravatar image

updated 2013-07-16 08:09:07 -0600

I just followed the tutorial and writing in eclipse

import org.opencv.core.CvType;
import org.opencv.core.Mat;
public class Main {
    public static void main(String[] args) {
      System.loadLibrary("opencv_java244");
          Mat m = Mat.eye(3, 3, CvType.CV_8UC1);
          System.out.println("m = " + m.dump());
    }
}

I get

Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java244in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
    at java.lang.Runtime.loadLibrary0(Runtime.java:840)
    at java.lang.System.loadLibrary(System.java:1047)
    at Main.main(Main.java:9)

same problem with netbeans thought the libraries exist including the opencv native i.e libopencv.so

SOLUTION:

after you find the .jar

the next you should do set the native library location '~~~~~~~~~/opencv/build/lib'

to import the libopencv_java246.so to native library location.

Hope that helps you.

Thanks

edit retag flag offensive close merge delete

Comments

Basically I do not get why you are posting this question if you already have the solution? Could you point to a topic where this problem arised? We can then copy the answer to it.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-07-16 08:07:41 -0600 )edit