I am currently try to develop Java application which will use OpenCV library. I was trying to test my openCV configuration using testNg framework like this:
@Test
public void openCVTest(){
System.out.println("OpenCV configuration simple test:");
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
Mat m = Mat.eye(3,3, CvType.CV_8UC1);
System.out.println("OpenCV matrix = " + m.dump());
}
However that produced an error:
java.lang.UnsatisfiedLinkError: no opencv_java300 in java.library.path
I have found multiple answers(even on stackoverflow) and they all suggested bad configuration with some solutions which i tried. In the end I tried to run same code but this time in app like this:
public class App {
public static void main( String[] args ){
System.out.println("OpenCV configuration simple test:");
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
Mat m = Mat.eye(3,3, CvType.CV_8UC1);
System.out.println("OpenCV matrix = " + m.dump());
}
}
And it is working like it suposed to. So my question is, why isn't this working with testing framework? Perhaps somehow i must also configure openCV library for tests?