[RC3] [HowTo] run Sikuli on a Windows machine having Java 7 and Java 6

Created by RaiMan on on 2013-02-02
Keywords:
Last updated by:
RaiMan on on 2013-05-18

The following steps allow to use Sikuli X without changing anything in your current Java installation.

In the following %xxxx% are environment variables, whose content you can evaluate on the command line by issuing the command set (list is alphabetically sorted).

--1. make sure you have the latest Sikuli version r930 (http://www.sikuli.org/download.html) and it is installed in
%ProgramFiles%\Sikuli X (32-Bit Windows)
%ProgramFiles(x86)%\Sikuli X (64-Bit Windows)

--2. make sure you have a valid Java 6 installation in
%ProgramFiles%\Java\jre6 (32-Bit Windows)
%ProgramFiles(x86)%\Java\jre6 (64-Bit Windows)

If you have your Java somewhere else or only a Java JDK installed, then your JAVA_HOME folder in the following batch files is the folder, that contains the bin folder of the jre subfolder (sounds complicated, but YOU decided to have a non-standard Java installation ;-)

--3. make a command file (e.g. mySikuliIDE.bat) to use the IDE:
with the following content for Windows 32 Bit:

setlocal
PATH=%ProgramFiles%\Sikuli X\libs;%ProgramFiles%\Java\jre6\bin;%PATH%
set SIKULI_HOME=%ProgramFiles%\Sikuli X\
set JAVA_HOME=%ProgramFiles%\Java\jre6
set JPARM=-Xms64M -Xmx512M -Dfile.encoding=UTF-8
set JEXE=%JAVA_HOME%\bin\java.exe
set SJAR=%SIKULI_HOME%sikuli-script.jar
"%JEXE%" %JPARM% -Dpython.path="%SJAR%/" -jar "%SJAR%" %*
endlocal

--4. (optional) make a command file (e.g. mySikuliScript.bat) If you want to run scripts this way or want an interactive session:
with the following content for Windows 32 Bit:

setlocal
PATH=%ProgramFiles%\Sikuli X\libs;%ProgramFiles%\Java\jre6\bin;%PATH%
set SIKULI_HOME=%ProgramFiles%\Sikuli X\
set JAVA_HOME=%ProgramFiles%\Java\jre6
set SJAR=%SIKULI_HOME%sikuli-script.jar
"%JAVA_HOME%\bin\java.exe" -jar "%SJAR%" %*
endlocal

--5. Windows 64Bit
in the above .bat's replace %ProgramFiles% with %ProgramFiles(x86)%

*** the trailing \ in SIKULI_HOME is mandatory !!

-- usage of the IDE bat is the same as Sikuli-IDE.bat
-- usage of the Script bat: either -i or path-to-some-script.sikuli as parameter