OpenCV 2.4.13.4 dll link error for Java on windows10 OS
I am running the following Java code snippet running JVM 1.8 for OpenCV 2.4.13 version:
Java Code Start
public static void main(String[] args){
System.out.println("Welcome to OpenCV " + Core.VERSION); System.loadLibrary(Core.NATIVE_LIBRARY_NAME); Mat m = Mat.eye(3, 3, CvType.CV_8UC1); System.out.println("m = " + m.dump()); }
Java Code End
I get this error:
Welcome to OpenCV 2.4.13.4 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:1468) at HelloCV.main(HelloCV.java:29)
I have tried the following:
- Putting the dll full path name on System.loadLibrary
- Passing the dll path to JVM version 1.8
- Putting the dll file into the windows system32 folder
- Putting the dll path name into eclipse opencv.jar config
Any ideas how this can be resolved
justsome remarks:
static {}
block, not into main(), so you're sure it'S loaded before main() gets called.System.load()
, notSystem.loadLibrary()
(and you also have to specify the.dll
extension)java.library.path
, not on the classpath (that's for jars and class files only)