UnsatisfiedLinkError given by Highghui.imread() on java [closed]
I want to use opencv in eclipse, so I built the opencv with java, and used it in eclipse. But I ran into the following problem when reading image using imread().
Mat image = Highgui.imread("f:/smoothed1.jpg");
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.opencv.highgui.Highgui.imread_1(Ljava/lang/String;)J
at org.opencv.highgui.Highgui.imread_1(Native Method)
at org.opencv.highgui.Highgui.imread(Highgui.java:352)
at HelloCV.main(HelloCV.java:12)
Environment: win7 64bit opencv-2.4.6 jdk1.7.0_21
I searched a lot and have checked the native library path, but not work. So, any help is appreciated. Thanks.
is it only imread ? or a general problem ?
did you add the path to the opencv-dlls to your PATH env var ?
(since the code in the opencv.jar depends on finding the dlls)
U r right, it is a general problem. I put the directory that contains opencv-java246.dll in PATH and CLASSPATH. And opencv libs were indeed chosen to be built as static libs. But the problem is still there.
I have found where the problem is. I should load the native library in the code which I didn't realized before. I really should look at the example in opencv first.