← Back to team overview

sikuli-driver team mailing list archive

[Question #187439]: Able to run a script through Netbeans, but not the compiled .jar

 

New question #187439 on Sikuli:
https://answers.launchpad.net/sikuli/+question/187439

import org.sikuli.script.*;

public class Test {

    public static void main(String[] args) {
        Screen s = new Screen();
        try {
            s.click("windows.png");
        } catch (FindFailed ex) {
            ex.printStackTrace();
        }
    }
}

This script executes fine in Netbeans with JDK 1.6, but when I try running the built .jar from the command line, I get:
Exception in thread "main" java.lang.NoClassDefFoundError: org/sikuli/script/FindFailed
     at java.lang.Class.getDeclaredMethods0(Native Method)
...etc.

I've been trying to find a solution via google and the answer search here, but I can't seem to resolve the issue.  I'm using Windows 7 64-bit, latest version of Sikuli, Netbeans 7.1, Sikuli-script.jar (r930) included with the Netbeans library along with JDK 1.6.

These are my User Environment Variables:
JAVA_HOME:
  C:\Program Files (x86)\Java\jre6
Path:
  %CommonProgramFiles%\Microsoft Shared\Windows Live;C:\Program Files (x86)\Sikuli X\libs;C:\Program Files (x86)\Java\jre6\\bin;C:\Jython2.5.2\;C:\GNUstep\bin;C:\GNUstep\GNUstep\System\Tools
SIKULI_HOME:
  C:\Program Files (x86)\Sikuli X\


I love Sikuli, and I'm starting the process of converting my scripts to Java since it's the language I'm currently studying.  I'm working on typing up a personal javadoc for the org.sikuli.script classes to assist me in this transition to Java.

I really appreciate the help.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.