Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

cannot run opencv in java

i follow step by step at website "http://docs.opencv.org/2.4/doc/tutorials/introduction/java_eclipse/java_eclipse.html" to build first opencv project in eclipse . But it does not work. Here is my code:

package game2;

import org.opencv.core.Core; import org.opencv.core.CvType; import org.opencv.core.Mat;

public class hello {

public static void main( String[] args ) {

  System.loadLibrary( Core.NATIVE_LIBRARY_NAME );

  Mat mat = Mat.eye( 3, 3, CvType.CV_8UC1 );

  System.out.println( "mat = " + mat.dump() );

} }

And Error :

Exception in thread "main" java.lang.UnsatisfiedLinkError: org.opencv.core.Mat.n_eye(III)J

at org.opencv.core.Mat.n_eye(Native Method)

at org.opencv.core.Mat.eye(Mat.java:492)

at game2.hello.main(hello.java:12)

Could you help me solve this problem ? Thanks you so much

click to hide/show revision 2
retagged

updated 2015-11-03 11:43:56 -0600

berak gravatar image

cannot run opencv in java

i follow step by step at website "http://docs.opencv.org/2.4/doc/tutorials/introduction/java_eclipse/java_eclipse.html" to build first opencv project in eclipse . But it does not work. Here is my code:

package game2;

import org.opencv.core.Core; import org.opencv.core.CvType; import org.opencv.core.Mat;

public class hello {

public static void main( String[] args ) {

  System.loadLibrary( Core.NATIVE_LIBRARY_NAME );

  Mat mat = Mat.eye( 3, 3, CvType.CV_8UC1 );

  System.out.println( "mat = " + mat.dump() );

} }

And Error :

Exception in thread "main" java.lang.UnsatisfiedLinkError: org.opencv.core.Mat.n_eye(III)J

at org.opencv.core.Mat.n_eye(Native Method)

at org.opencv.core.Mat.eye(Mat.java:492)

at game2.hello.main(hello.java:12)

Could you help me solve this problem ? Thanks you so much