Reputation: 83
Goodmorning,
Today I started with a POC with SikuliX and Java. I want to try the example in this link. Here a part of the screen is captured and searched.
When I execute this, I receive the error:
[error] RunTimeAPI: loadLib: opencv_java not usable:
java.lang.UnsatisfiedLinkError: no opencv_java in java.library.path: [/usr/java/packages/lib, /usr/lib/x86_64-linux-gnu/jni, /lib/x86_64-linux-gnu, /usr/lib/x86_64-linux-gnu, /usr/lib/jni, /lib, /usr/lib]
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.sikuli.script.FindInput2.<clinit>(FindInput2.java:17)
at org.sikuli.script.Finder.<init>(Finder.java:21)
at org.sikuli.script.Region.doCheckLastSeenAndCreateFinder(Region.java:2936)
at org.sikuli.script.Region.checkLastSeenAndCreateFinder(Region.java:2897)
at org.sikuli.script.Region.doFind(Region.java:2827)
at org.sikuli.script.Region.find(Region.java:2325)
at Apl.sikuliXHighlight(Apl.java:50)
at Apl.main(Apl.java:26)
Caused by: org.sikuli.script.SikuliXception: fatal: problem with native library: opencv_java
at org.sikuli.script.RunTime.terminate(RunTime.java:70)
at org.sikuli.script.RunTime.libsLoad(RunTime.java:792)
at org.sikuli.script.RunTime.loadLibrary(RunTime.java:949)
at org.sikuli.script.Finder2.<clinit>(Finder2.java:35)
... 8 more
[4346 debug] RunTimeAPI: ***** final cleanup at System.exit() *****
I added the library to my POM.XML. But that didn't help.
Did I use the wrong library?
Some additional info: I am using Intellij on an Ubuntu 18.10 machine.
If I missed something, please let me know. Many thanks in advance.
@Edit:
I had checked out the possible duplicate post. But I am not using OpenCV, but SikuliX. I just need OpenCV as a dependency (as it is being used by SikuliX).
@Edit2: After more digging and trying to follow the information from the link (duplicate) I found this. Which provides the required info for use on Linux systems.
Upvotes: 3
Views: 1756
Reputation: 76
First check java version.
java -version
After that install opencv
sudo apt install libopencv3.2-java
sudo ln -s /usr/lib/jni/libopencv_java320.so /usr/lib/libopencv_java.so
Upvotes: 3