[1.0] Eclipse: Jython: Windows - Native library could not be extracted ...

Asked by Bunnings

*** the problem

- there is an existing and working RC3 installation on Windows in C:\Program Files\Sikuli X
- the content of this folder is replaced with the stuff from Sikuli 1.0.0
- the standard usage works fine, but using Jython scripting in Eclipse (which works with the RC3 setup) produces the error

*** the solution

Just add in Eclipse -> Run -> Run Configurations -> Arguments the VM argument

-Dsikuli.Home="C:\Program Files\Sikuli X"

more information: https://github.com/RaiMan/SikuliX-API/wiki/Usage-in-Java-programming

-------------------------------------------------------------------------------------------------------------------------------

**** I am using Eclipse IDE with Jython interpretor ****

I downloaded the libraries for the new IDE version Windows 32 bit this morning.

1) I renamed all the previous version of Sikuli installation to Sikuli Y.
2) Copied the new libraries to program files and named Sikuli X.
3) Copied the new libraries to C:/Jython v/Lib/Site packages/Sikuli X

When I try running the tests I am getting the below error

*sys-package-mgr*: processing modified jar, 'C:\Program Files\Sikuli X\sikuli-script.jar'
[error] org.sikuli.script.FileManager.loadLibrary: Native library could not be extracted nor found: VisionProxy

I can see the VisionProxy.dll inside the lib folder. The folder structure seems to be same as previous version.
I also tried the same steps using API version Windows 32 bit and get the same error. I have made no changes to environment variables as it is not required I guess.

Apart from above, I would like to know why we copy Sikuli X into site packages folder in Jython lib.

I checked the readme.txt and this issue is mentioned :-) but libs and sikuli and scripts are in the same directory

C:/Program files/Sikuli X/Sikuli-script.jar
C:/Program files/Sikuli X/libs/

Question information

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

This is what I understand:
- You are scripting Jython in Eclipse
- You had a Sikuli-rc3 installation in C:/Program Files/Sikuli X
- your system path includes an entry C:/Program Files/Sikuli X/libs

- Then you downloaded and unzipped a Win32 package (I suppose it was Sikuli-IDE-1.0.0-Win32.zip, since the IDE is of value in some cases, even if you do your scripting in Eclipse)

- you renamed C:/Program files/Sikuli X to C:/Program Files/Sikuli Y
- you copied the content of the unzipped folder to C:/Program Files/Sikuli X so the content among others now is:
C:/Program Files/Sikuli X/libs/... containing the new libs
C:/Program Files/Sikuli X/sikuli-script.jar

- with this, you are in a situation, where you should not have to change anything to your Eclipse or system setup (Jython site-packages see below)

- in Eclipse, I suppose you have C:/Program files/Sikuli X/sikuli-script.jar in your class path

*** Jython site-packages
If the tests ran before with your Eclipse Jython setup, they should run now too.

Though C:/Jython v/Lib/Site packages/Sikuli X looks a bit strange, since the standard folder naming in a standard Jython setup is
<jython installation folder>/Lib/site-packages

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

I have tested the situation with Eclipse and Jython on Win7-32 - works perfectly

I have setup a short info on that topic:

https://github.com/RaiMan/SikuliX-API/wiki/Usage-in-Java-programming

Revision history for this message
Bunnings (sillybilly) said :
#3

Raiman, thank you for your response. yes it should have worked. That was my expectation and hence I chose to do it that way. However it didn't work and I got the error.

------------------------------------------------------------------------------------------------------------------------------------------------
w.r.t. jython site packages
its installation folder is C: drive, C:/Jython 2.5.3/Lib/site-packages
and that is not the issue. My Q(and is not related to the reported issue) was, I have copied the Sikuli X contents into site-packages folder when I set up initially. Why are we doing this?
--------------------------------------------------------------------------------------------------------------------------------------------------

 I have reverted to the old version and is working now.

I will repeat the above steps again tomorrow morning to see how it goes and will report back to you. Thank you once again.

Revision history for this message
Bunnings (sillybilly) said :
#4

More information

System: Windows XP, jre6

Environment variables
-----------------------------
Path = C:\Program Files\Sikuli X\libs;C:\Program Files\Java\jre6\\bin
SIKULI_HOME = C:\Program Files\Sikuli X\

In Eclipse, I have
CLASSPATH = C:\Program Files\Sikuli X\sikuli-script.jar
JYTHONPATH = C:\jython2.5.3\Lib;C:\Program Files\Sikuli X\sikuli-script.jar\Lib

I also have C:\Program Files\Sikuli X\sikuli-script.jar added to project -> properties -> external libraries

Now this settings work perfectly with the previous version of Sikuli.

I am still getting the reported error with the sikuli 1.0

Revision history for this message
Bunnings (sillybilly) said :
#5

Hi Raiman, I also tried the supplemental stuff and didn't work.

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

You can leave everything as is.

Just add in Eclipse -> Run -> Run Configurations -> Arguments the VM argument

-Dsikuli.Home="C:\Program Files\Sikuli X"

Revision history for this message
Bunnings (sillybilly) said :
#7

Thanks RaiMan, that solved my question.

Revision history for this message
Jorge (jantillonc) said :
#8

Hey guys, I am running into a very similar issue:

[error] org.sikuli.script.FileManager.loadLibrary: Native library could not be loaded: VisionProxy
[error] Since native library was found, it might be a problem with needed dependent libraries
java.lang.UnsatisfiedLinkError: C:\Program Files (x86)\Sikuli-IDE-1.0.0-Win64\libs\VisionProxy.dll: Can't find dependent libraries
 at java.lang.ClassLoader$NativeLibrary.load(Native Method)
 at java.lang.ClassLoader.loadLibrary1(Unknown Source)
 at java.lang.ClassLoader.loadLibrary0(Unknown Source)

This is whenever I try to run my scripts.
I downloaded the new sikuli: Sikuli-IDE-1.0.0-Win64
System Windows 7
Java version : 1.7.0_-5 64 bit

Enviromental variables: SIKULI_HOME: C:\Program Files (x86)\Sikuli-IDE-1.0.0-Win64\libs;
Path: C:\Program Files (x86)\Sikuli-IDE-1.0.0-Win64\libs;

Eclipse variables:
CLASSPATH = C:\Program Files (x86)\Sikuli-IDE-1.0.0-Win64\sikuli-script\Lib
JYTHONPATH = C:\Program Files (x86)\Sikuli-IDE-1.0.0-Win64\sikuli-script\Lib

Already did what you pointed in https://github.com/RaiMan/SikuliX-API/wiki/Usage-in-Java-programming about the external Jython and copied the folder into my Jython Lib.
Also I set the VM argument as you said and still get the same error.

Any help would me greatly appreciated.

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

@Jorge
already seen the workaround at the top of the question?