Sikuli X fails to execute scripts via NetBeans, Eclipse or Jython using sikuli-script.jar

Asked by surfdork

You may find yourself in this situation, when using sikuli-script.jar standalone in other environments than just together with Sikuli-IDE:
- using other IDE's like Netbeans or Eclipse
- using plain Jython to run your scripts
- using Java.exe and sikuli-script.jar to run your scripts

and try to just port your solution from 10.2

--- for 64-Bit Systems (Windows/Linux) and mixed 64-Bit/32-Bit Systems (Windows/Linux) the following solution might not help (still under investigation)

--- This solution applies to:
OS Win7 starter x32
OS Win 7 ultimate x32
(and probably all 32-bit Windows)

Mac: special adjustments needed (if interested contact RaiMan)
Linux: similar to Windows (but you need to install openCV 2.1 on your own)

--- Description:
-- User unable to run sikuli scripts when using Sikuli X component sikuli-script.jar standalone (referenced in Java Class Path and/or Python Path (sys.path))
-- Error messages say that there are problems finding/loading dependent libraries, mainly with reference to
-- in the error trace back you find
at com.wapmx.nativeutils.jniloader.NativeLoader.loadLibrary(

see an example error log below.

--- How to get it going?
-- take care, that any references to 10.2 components are removed in your environment
-- have the following entries in your system path (Windows: System settings -> advanced -> environment variables)
(e.g. add C:\Program Files\Sikuli X\libs;C:\Program Files\Java\jre6\bin)
adjust these path specifications to your environment

--- additional things that might be helpful:
-- when using an unjared version of sikuli-script.jar, it might be helpful, to put this reference in the system path too:
-- be aware, that the Sikuli java classes now live at org.sikuli.script (if you are working on the java level)
-- if you have problems importing built-in Python modules: read bug 702155
-- if you want to use Jython 2.5.2: read

--- Here an example error log:
VDictProxy loaded.
Traceback (most recent call last):
  File "C:\Users\Mike\Documents\NetBeansProjects\NewPythonProject\src\", line 4, in <module>
    from sikuli.Sikuli import *
  File "C:\UnjarSikuliScript\Lib\sikuli\", line 183, in <module>
  File "C:\UnjarSikuliScript\Lib\sikuli\", line 178, in initSikuli
    dict['SCREEN'] = Screen()
  File "C:\UnjarSikuliScript\Lib\sikuli\", line 16, in __init__
    r = JScreen().getBounds()
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)

        at java.lang.ClassLoader.loadLibrary0(Unknown Source)

        at java.lang.ClassLoader.loadLibrary(Unknown Source)

        at java.lang.Runtime.load0(Unknown Source)

        at java.lang.System.load(Unknown Source)

        at com.wapmx.nativeutils.jniloader.NativeLoader.loadLibrary(

        at org.sikuli.script.Win32Util.<clinit>(

        at java.lang.Class.forName0(Native Method)

        at java.lang.Class.forName(Unknown Source)

        at org.sikuli.script.Env.getOSUtil(

        at org.sikuli.script.ScreenHighlighter.init(

        at org.sikuli.script.ScreenHighlighter.<init>(

        at org.sikuli.script.Screen.initBounds(

        at org.sikuli.script.Screen.<init>(

        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

        at java.lang.reflect.Constructor.newInstance(Unknown Source)

        at org.python.core.PyReflectedConstructor.constructProxy(

java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: C:\Users\Mike\AppData\Local\Temp\tmplib\Win32Util.dll: Can't find dependent libraries

Revision history for this message
Tsung-Hsiang Chang (vgod) said :

Please check if you have the path to the JRE\bin in the environment variable PATH.

Revision history for this message
RaiMan (raimund-hocke) said :

To be able to link it to the request bug

Revision history for this message
RaiMan (raimund-hocke) said :

RaiMan suggests this article as an answer to your question:
FAQ #1436: “Using sikuli-script.jar standalone: Eclipse, NetBeans, Jython, plain JAVA, ...”.

Revision history for this message
surfdork (surfdork) said :

Still fails. What is the working recipie?

Revision history for this message
RaiMan (raimund-hocke) said :

What is happening?

What is your configuration?

I have it running with Netbeans or plain Jython or plain java only using sikuli-script.jar and the native libs that come with the distribution on Mac OS X 10.6 and Windows 7.

Revision history for this message
RaiMan (raimund-hocke) said :

*** see related bugs

Revision history for this message
Omkkumar (varsini1989) said :

Can u pls explain wat is meant exactly by java class path and python sys.path.?

Revision history for this message
RaiMan (raimund-hocke) said :

Uuups, that is basic knowledge ;-)

java class path: see Java docs

sys.path: see Python docs