Sikuli出现ImagePath故障(JAVA) [英] Sikuli Trouble with ImagePath (JAVA)
问题描述
我在使用sikuli库的eclipse中导出Maven项目时遇到问题.在eclipse中,一切正常,应用程序运行良好.我还必须指出,我以前从未使用过Maven(因此我可能会做一些愚蠢"的事情).问题在于,一旦导出,应用程序将找不到我存储在可运行jar中的图像.这是我收到的错误: https://drive.google.com/file/d/0BymG7-nABOfnTmR0NzdTXzlSU2M/view
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
图像存储在sikuli映射内的资源中.您可以在此处查看代码和项目层次结构: https://drive.google.com/file/d/0BymG7-nABOfnazJqYTg5ekJzSFE/view?usp=sharing
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
主要方法是在Launcher.java中编写的.我认为代码中的问题位于ImagePath.add行附近.谁能帮我,所以应用程序在eclipse之外运行?
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?
这些网站上有一些有关ImagePath的信息: http://sikulix-2014.readthedocs.org/en /latest/faq/030-java-dev.html http://sikulix-2014.readthedocs.org/en/latest/scripting .html#imagesearchpath
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
预先感谢
推荐答案
尝试一下,
导入以下
import org.sikuli.basics.ImageLocator;
在程序中使用此功能
ImageLocator.setBundlePath("path to img directory");
这篇关于Sikuli出现ImagePath故障(JAVA)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!