Search code examples
rubywindowswindows-7jrubysikuli

Using JRuby+Sikuli on Windows


This video shows JRuby+Sikuli working on Windows 7 or higher. There we have to require "java"; require "sikuli".
So I've installed SikuliX using sikuli-setup.jar and did some practice in Sikuli IDE.
However the \jruby-1.7.15\bin\gem install java gives java requires Ruby version >= 2.1.0., since the latest JRuby installer is jruby 1.7.15 (1.9.3p392), so I had to ... install-fjava.
Then I had to manually set ENV variable SIKULI_HOME, but now I have this error:

irb> require "sikuli"
LoadError: Failed to load 'C:\Users\admin\Downloads\nakilon\sikuli/sikuli-script.jar'
Is Sikuli installed?

And yes, I have no sikuli-script.jar in my SikuliX folder.
So what is the proper way to make JRuby+Sikuli[X] to work on Windows 7/8?

UPD: I just realized, that gem install sikuli installs a 2 years old stuff, that isn't a Sikuli X.
So I did a hack -- renamed sikuli-ide.jar to sikuli-script.jar.
Trying to execute some lines from that video: screen = Sikuli::Screen.new goes fine.
But since script = org.sikuli.script.SikuliScript.new gives:

cannot load Java class org.sikuli.script.SikuliScript

I checked github sources -- there is really no SikuliScript class, so now I'm lost (


Solution

  • Checksums of files in it:

    MD5 (jruby_windows_1_7_15.exe) = 61600abdb47177dc50c4ec887dc6c3f1
    MD5 (sikulixsetup-1.1.0-Beta4.jar) = 7b836f4dad2e6817fd599f91cb1b9e7f
    MD5 (sikulix-1.1.0.3.gem) = e1083cf09b55c917b62a34cc45cdded0
    

    Google Drive doesn't allow to share .exe, so you'll see only two files.