Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Java - Can't find dependent libraries

So I built OpenCV with CMake using Visual Studio 2017 and I'm trying to use the Java bindings.

I built it with "cmake.exe --build . --config Release --target INSTALL".

In IntelliJ, I add the JAR as a library and add the native library location D:\Documents\opencv\opencv2\opencv-3.4.1\build\install\java, which contains opencv_java341.dll.

When I try to run my java code, I get the error Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\Documents\opencv\opencv2\opencv-3.4.1\build\install\java\opencv_java341.dll: Can't find dependent libraries.

One thing I noticed is that when I tried with the prebuilt version (which seems to work but doesn't have the contrib modules), opencv_java341.dll is 45,140 KB while the one I built is only 2,063 KB.

What should I do?