Running a runnable jar moved to another pc

Asked by Henrique on 2019-04-08

So I managed to develop a program for automation in Sikuli and exported as a runnable JAR. Everything works, except if I run it from another PC for example because I get the error of missing images which are in the Sikuli.Sikuli in My Documents folder. My question is: do I ALWAYS need that folder to be in My Documents?

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2019-04-08
Last query:
2019-04-08
Last reply:
2019-04-08
Best RaiMan (raimund-hocke) said : #1

You have to move the images to a folder inside your java project and use the addImagePath() variant, that accepts a Java Class, that is on classpath at runtime.

see docs.

Be aware: The feature "export as runnable jar" is no longer supported with 1.1.4+

You will always need a valid SikuliX environment on other machines, to run your jar there.

java -cp <path-to>/sikulixapi.jar:your.jar your.Main.Class

Henrique (guima) said : #2

Thanks RaiMan, that solved my question.