简体   繁体   中英

Sikuli Trouble with ImagePath (JAVA)

I'm having a problem exporting a maven project in eclipse that uses the sikuli library. In eclipse everything works fine and the application runs great. I also have to note that I never used maven before (so I might do something "stupid"). The problem is that once exported, the application can't find the images I stored within the runnable jar. This is the error I got: https://drive.google.com/file/d/0BymG7-nABOfnTmR0NzdTXzlSU2M/view

The images are stored in resources inside the sikuli map. You can see the code and project hierarchy over here: https://drive.google.com/file/d/0BymG7-nABOfnazJqYTg5ekJzSFE/view?usp=sharing

The main method is written inside Launcher.java. I think the problem in my code is located near the ImagePath.add line. Can anyone help me, so the application runs outside eclipse?

There is some information about ImagePath on these websites: http://sikulix-2014.readthedocs.org/en/latest/faq/030-java-dev.html http://sikulix-2014.readthedocs.org/en/latest/scripting.html#imagesearchpath

Thanks in advance

try this,

Import the following

 import org.sikuli.basics.ImageLocator;

use this function inside your program

ImageLocator.setBundlePath("path to img directory");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM