【问题标题】:How to create executable (.exe) file for any platform using Sikuli-script + Java + Eclips IDE如何使用 Sikuli-script + Java + Eclipse IDE 为任何平台创建可执行 (.exe) 文件
【发布时间】:2014-02-07 06:42:45
【问题描述】:

我已经使用sikuli-script(latest version 1.0.1) 创建了java application。

我将sikuli-script.jar 添加到Referenced Libraries(我使用此答案配置Answer Link)

java code 文件夹结构 -->

Java code -->

package com.example.sikuli;

import org.sikuli.script.*;
import java.util.concurrent.TimeUnit;    

public class TestSikuli {

    public static void main(String[] args) {
            Screen s = new Screen();
            App app = new App("C:/Program Files/Mozilla Firefox/firefox.exe");//firefox path
            try{
                    app.focus();
                    TimeUnit.SECONDS.sleep(2);
                    s.click("imgs/1391152193781.png", 0);//url bar image   
                    s.type(null, "http://www.google.lk", 0);  
                    s.click("imgs/1391152289812.png", 0);//click search image
            }
            catch(FindFailed e){
                    e.printStackTrace();
            }
    }

}

之后我设置了Run Configutrtion,例如PATH和SIKULI_HOME

接下来我运行它正常工作的代码。

然后我使用launch4j 并根据此站点说明创建.exe --> How to Create an Executable File from Eclipse

之后我从command prompt 运行.exe 文件,然后出现以下错误。请帮帮我。

Error -->

[error] ResourceLoaderBasic: check: libs dir is empty, has wrong content or is outdated

[action] ResourceLoaderBasic: check: Please wait! Trying to extract libs to: C:\Documents and Settings\Dell\SikuliX\libs

[error] ResourceLoaderBasic: loadLib: Fatal Error 109: not found: C:\Documents and Settings\Dell\SikuliX\libs\VisionProxy.dll

[error] Terminating SikuliX after a fatal error(109)! Sorry, but it makes no sense to continue!

If you do not have any idea about the error cause or solution, run againwith a Debug level of 3. You might paste the output to the Q&A board.

【问题讨论】:

    标签: java eclipse sikuli


    【解决方案1】:

    --1。在使用 Sikuli 进行 Java 编程时,您应该始终使用 sikuli-java.jar(sikuli-ide.jar 包含很多这里不需要的东西)。

    --2。运行 exe 时设置 JVM 选项 -Dsikuli.Debug=3 以获取有关正在发生的事情的更多详细信息。我想问题是,由于某种原因,本机库的导出在 launch4J exe 的上下文中不起作用(我还没有对此进行测试)。

    --3。始终使用最新版本(在这种情况下为 1.1.1,仍然是每晚但预决赛;-) http://sikulix.com

    【讨论】:

    • 我修改了您在上面的答案中提到但仍然存在问题。请帮助我如何创建(.exe)文件。
    • 我通过 Maven 使用 Sikuli。我没有为 sikuli-java.jar 文件进行 Sikuli 设置。在服务器中运行 sikuli 代码时,我收到了找不到路径错误,建议重新启动机器。它是一台服务器,我无法执行重新启动操作。我们有什么办法可以避免重启操作来修复这些错误。
    猜你喜欢
    • 1970-01-01
    • 2012-06-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-14
    • 2014-04-13
    • 2010-12-27
    相关资源
    最近更新 更多