← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #139787]: Could not initialize Finder class (Sikuli X)

 

Question #139787 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/139787

    Status: Open => Answered

RaiMan proposed the following answer:
The answer you refer to is a bit out of date and too confusing, when
using Pydev within Eclipse.

... contained in path specifications later on have to be adjusted to
your situation

The following approach works and is the base for every usage of standalone sikuli-script.jar in Windows with Jython:
- make sure, the native dll's are found (Sikuli installation directory libs and ...Java\jre6\bin)
- have sikuli-script.jar in the Java class-path (in the Sikuli installation directory)
- have the folder Lib contained in sikuli-script.jar in the Python path
- before saying from sikuli.Sikuli import * to initialize Sikuli

1. remove everything that points to something related to 10.2 (%PATH%
and other environment settings like Java Class Path or Jytho/Python
path's), Eclipse global Settings, Project settings in Pydev -
Pythonpath)

2. In Windows system settings -> advanced -> environment settings make sure the following entries are included in PATH:
...path to your Sikuli X folder\libs
...path to your Java\jre6\bin
these entries are needed for Sikuli to find the native libraries (dll's)

3. unjar the sikuli-script.jar to a directory of your choice. You can use the jar utility located in ...Java\jdk...\bin as follows after  going to the target directory:
...Java\jdk...\bin\jar.exe -xf ...path to your Sikuli X folder\siculi-script.jar

this new directory (to find the Java classes) and the contained
directory Lib (to find the Python stuff) both have to be in a projects
external libraries.


To unjar the sikuli-script.jar is not necessary, if you succeed in getting the entry 
...path to your Sikuli X folder\siculi-script.jar\Lib 
into the python sys.path before running the script (I did not find a way to add it using the features of the Pydev settings pane) (on Windows this is possible with Netbeans)


I did not check the many other possibilities to use Java and/or Jython related environment variables or general settings in Eclipse (not my focus, I am using NetBeans).

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