Exception in thread "main" java.lang.NoSuchMethodError: org.sikuli.basics.Debug.init()V

Asked by jerome on 2018-02-14

I have added following Jar's in Eclipse:
sikulixsetup-1.1.1.jar
sikulixapi.jar
sikuli-setup.jar

I got the below error while running the code:

Exception in thread "main" java.lang.NoSuchMethodError: org.sikuli.basics.Debug.init()V
 at org.sikuli.script.RunTime.get(RunTime.java:157)
 at org.sikuli.script.RunTime.get(RunTime.java:124)
 at org.sikuli.script.RunTime.get(RunTime.java:323)
 at org.sikuli.script.Region.<clinit>(Region.java:31)
 at sikulipak.Testing.main(Testing.java:8)

Code:

package sikulipak;

import org.sikuli.script.*;

public class Testing {

        public static void main(String[] args) {
                Screen s = new Screen();
                try{
                        s.click("imgs/spotlight.png");
                        s.click();
                        s.write("hello world#ENTER.");
                }
                catch(FindFailed e){
                        e.printStackTrace();
                }
        }
}

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2018-02-15
Last query:
2018-02-15
Last reply:
2018-02-14
Best RaiMan (raimund-hocke) said : #1

I have added following Jar's in Eclipse:
sikulixsetup-1.1.1.jar
sikulixapi.jar
sikuli-setup.jar

These should not be there:
sikulixsetup-1.1.1.jar
sikuli-setup.jar

The only needed:
sikulixapi.jar

... but it must be a jar created with setup option 2

jerome (jeromeaerockiam) said : #2

Thanks RaiMan, that solved my question.