Ask Your Question

Revision history [back]

Error when I try to run Hello World OpenCV sample using java and eclipse

can anyone help me with opencv4 showing me a guide about how to configure opencv4 in eclipse?

I am using OS X and I prefer to use java instead of python.

I can see that there is an outdated guide, version 2.4.6, which is not longer present in release page

https://opencv.org/releases/

Downloading version 4 from that link does not solve my problem, because there is not any jar file. I can download it via mvnrepository.com

I can add the jar to eclipse, going to java, build path, user libraries, but, if I try to run the typical Hello world class

https://pastebin.com/vczZbaRt

I got this message:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java400 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1122) at Hello.main(Hello.java:9)

The exact jar file that I am using.

I have compiled opencv4 sources from scratch, following this guide. I can run python samples in my osx environment without a problem, but i would like to use java code instead of python.

Please, what do i have to do to have a fully functional eclipse environment to work with opencv 4 using java?