RaiMan / SikuliX-2014

SikuliX version 1.1.2 (until February 2018)
http://sikulix.com
805 stars 235 forks source link

Java: ImagePath not available when running from Eclipse as runnable jar #275

Closed tuyennta closed 6 years ago

tuyennta commented 6 years ago

I have downloaded the TestRunMaven project and import as maven project into eclipse, run the main class TestRun on eclipse => works! I tried to export this project as runnable jar file (with 1st option in library handling) => run the jar with command: java -jar sikuli3.jar => result error: D:\Users\tuyennta\workspace\default\Sikuli-demo\run\sikili-image>java -jar sikuli3.jar [debug] ImagePath: add: jar:file:/D:/Users/tuyennta/workspace/default/Sikuli-demo/run/sikili-image/sikuli3.jar!/ImagesAPI.sikuli [debug] ImagePath: new BundlePath:/D:/Users/tuyennta/workspace/default/Sikuli-demo/run/sikili-image/ [error] Image: Image not valid, but TextSearch is switched off! [debug] Region: handleImageMissing: test.png [debug] Region: handleImageMissing: Response.ABORT: aborting [error] RunTimeAPI: Wait: Abort: unknown [error] RunTimeAPI: ImageMissing: test.png [debug] RunTimeAPI: final cleanup [debug] FileManager: deleteFileOrFolder:D:\Users\tuyennta\AppData\Local\Temp\Sikulix_1213072878 Here is the structure of runnable jar: sikuli3 P/s: I also read the document and followed step to create a general java project or maven project, both worked when run in eclipse and did not work when export to jar file.

dmcgill50 commented 6 years ago

Are you able to find test.png in your runnable jar bundle? What's the path?

RaiMan commented 6 years ago

In this environment/usage one has to use a class based imagepath, which is still valid, when running as standalone jar.