问题
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
回答1:
try this,
Import the following
import org.sikuli.basics.ImageLocator;
use this function inside your program
ImageLocator.setBundlePath("path to img directory");
来源:https://stackoverflow.com/questions/28187543/sikuli-trouble-with-imagepath-java