NoClassDefFoundError for FindFailed

Asked by lobsang

Hi,
I installed the latest version of Sikulix and am running Jdk 1.8.0_40.
I compiled a small java program as follows:
javac -cp c:\sikulix\sikulix.jar Test.java

When executing the compiled program, however, I get a NoClassDefFoundError for FindFailed:
 java.lang.ClassNotFoundException: org.sikuli.script.FindFailed

How can I fix this problem? I have attached below the java code. I tried using different jars e.g. sikuli-script.jar, sikuli-java.jar but this did not make any difference.

Thanks,

Lobsang

import org.sikuli.script.*

public class Test {

        public static void main(String[] args) {
                Screen s = new Screen();
                try{
                        s.doubleClick("googleIcon.png", 0);
                        s.wait("addressBar.png",10);
      s.click("addressBar.png",0);
                        s.type(null, "www.google.com\n", 0);
                }
                catch(FindFailed e){
                        e.printStackTrace();
                }

  }
}

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

not really sure what you are doing and why, but:

--- in line
import org.sikuli.script.*

the trailing ; is missing.

--- then
javac -cp c:\sikulix\sikulix.jar Test.java

gives a Test.class, that can be executed with:

java -cp .:c:\sikulix\sikulix.jar Test

and works for me.

Revision history for this message
lobsang (intransparent) said :
#2

Hi,
Thanks for the quick response. The missing semicolon in the import statement was a copy and paste error when posting my message.

I was missing the current path indicator for specifying the jar location when executing the program. On windows this works:
java -cp .;c:\sikulix\sikulix.jar Test

Thanks.

Revision history for this message
lobsang (intransparent) said :
#3

Thanks RaiMan, that solved my question.