How to set SIKULI_HOME env variable after jar packaging?

Asked by Nikhil

Hi, till now I have tested my Java application for automation developed using Sikuli thro' Eclipse by setting the PATH and SIKULI_HOME env variables in the launch configuration itself. Now its time to deploy the application with jar packaging.

For this, I have created a batch file which will contain the SET commands for these two variables--
SET PATH=C:\JDK64\1.6.0.31.1\bin;C:\Sikuli-IDE-1.0.0-Win64\libs;
SET SIKULI_HOME=C:\Sikuli-IDE-1.0.0-Win64
java -jar myjar.jar

even though its not working and resulting in the infamous issue caused because of this.--

[error] org.sikuli.script.FileManager.loadLibrary: Native library could not be loaded: VisionProxy
java.lang.UnsatisfiedLinkError: C:\Sikuli-IDE-1.0.0-Win64\libs\VisionProxy.dll: Can't find dependent libraries

Can anyone help me to identify the right solution to set these variables before executing the jars.

Thank you,
iNikhil19

Question information

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

I guess you have to use:

SET PATH=C:\JDK64\1.6.0.31.1\bin;C:\Sikuli-IDE-1.0.0-Win64\libs;%PATH%

BTW: this is a better solution:

setlocal
SET SIKULI_HOME=C:\Sikuli-IDE-1.0.0-Win64
SET PATH=C:\JDK64\1.6.0.31.1\bin;%SIKULI_HOME%\libs;%PATH%
java -jar myjar.jar
endlocal

Revision history for this message
Nikhil (inikhil19) said :
#3

@RaiMan: I thought setting the environment variables would solve my problem, but looks like the env variables are set correctly in both the ways. Issue still persists.

Now I have a new question- Does java code in my jar should refer the sikuli-script.jar in jar's lib folder or the one present in the sikuli installation folder. C:\Sikuli-IDE-1.0.0-Win64?

Because, I observed the strange thing during development in Eclipse is, putting sikuli-script.jar in project's lib folder and referencing it from there results in error--
[error] org.sikuli.script.FileManager.loadLibrary: Native library could not be extracted nor found: VisionProxy

however, referencing sikuli-script.jar from the installation dir works perfectly.

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

I recommend to switch to version 1.0.1
start here: http://www.sikuli.org/download.html and read carefully, especially the information according using the new sikuli-java.jar in Java programming with IDE's like Eclipse.

Things are a lot easier and more robust now.

... and yes: latest beginning with the new version it is recommended (mandatory though, if you are not really sure what you are doing), to leave the Sikuli stuff in one place and only use references.

Can you help with this problem?

Provide an answer of your own, or ask Nikhil for more information if necessary.

To post a message you must log in.