Am not able to run the sikulix in eclipse, Sikulix throwing an error in cosolw

Asked by Kogul on 2020-06-09

When I try to run the below sample code, sikulix throwing an ExceptionInitializerError. Please find the below code. Please help me in resolving this.

Java Code:

public class FirstTestCase {
 public static void main(String[] args) {
  try {

   Pattern fileinputtextbox = new Pattern("D:\\sikupro\\sikuli\\sikuli\\images\\textinput.PNG");
   Thread.sleep(5000);
   Screen src= new Screen();
   Region reg= src.find("textinput.PNG");
   Thread.sleep(2000);
   reg.click();

  } catch (FindFailed e) {
   e.printStackTrace();
  } catch (InterruptedException e) {

   e.printStackTrace();
  }
 }
}

Exception:

Exception in thread "main" java.lang.ExceptionInInitializerError
 at org.sikuli.script.Pattern.<init>(Pattern.java:127)
 at sikuli.FirstTestCase.main(FirstTestCase.java:27)
Caused by: java.lang.NullPointerException
 at org.sikuli.script.support.RunTime.init(RunTime.java:1176)
 at org.sikuli.script.support.RunTime.get(RunTime.java:1060)
 at org.sikuli.script.support.RunTime.get(RunTime.java:915)
 at org.sikuli.script.support.RunTime.loadLibrary(RunTime.java:1689)
 at org.sikuli.script.Finder$Finder2.<clinit>(Finder.java:536)
 ... 2 more
Exception in thread "Thread-0" java.lang.NullPointerException
 at org.sikuli.script.support.RunTime.runShutdownHook(RunTime.java:1374)
 at org.sikuli.script.support.RunTime.access$000(RunTime.java:42)
 at org.sikuli.script.support.RunTime$3.run(RunTime.java:1056)

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2020-06-09
Last reply:
2020-06-10
RaiMan (raimund-hocke) said : #1

In any case it must be:
Region reg= src.find(fileinputtextbox);

What version of SikuliX? On what system?

Kogul (selvanathan4220) said : #2

Thanks for the reply RailMan Please find the below dependency.

<!-- https://mvnrepository.com/artifact/com.sikulix/sikulixapi -->
<dependency>
    <groupId>com.sikulix</groupId>
    <artifactId>sikulixapi</artifactId>
    <version>2.0.4</version>
</dependency>

RaiMan (raimund-hocke) said : #3

What Windows system version?

Looks like a problem with the opencv_java342.dll (probably needed DLL's missing on your system).

May be this helps:
https://bugs.launchpad.net/sikuli/+bug/1797505

Can you help with this problem?

Provide an answer of your own, or ask Kogul for more information if necessary.

To post a message you must log in.