导出与Sikuli的应用程序 [英] Exporting an app with Sikuli

查看:314
本文介绍了导出与Sikuli的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对java库sikuli有问题。
首先我下载了​​sikuli安装程序并执行它。它创建了sikuli-java.jar和一个libs文件夹(在c:/ documents / sikuli下)。之后,我在eclipse中创建了一个项目,将jar添加到构建路径并编写代码。当我在日食中运行代码时,代码工作。之后,我从它创建了一个可运行的jar。我跑了跑步的罐子。我打算将应用程序作为可运行的jar导出,并将其部署,而不需要用户安装sikuli。这是否可能?



另外: https://github.com/RaiMan/SikuliX-2014/wiki/Usage-in-Java-programming

 请注意,sikulixapi.jar位于项目的Java类路径

我甚至没有一个名为sikulixapi.jar的文件。



================================= ====



也许是一个快速的笔记,我已经创建了sikuli-java.jar与选项4和6.



编辑:
任何人?该应用程序在eclipse中工作正常,但是当我将其导出为可运行的jar并运行它时,只要它遇到关闭的sikuli东西。没有catch块触发,虽然我已经用catch(Exception ex)包围了代码。我已经配置了这样的eclipse: https://stackoverflow.com/a/10354759/2815780

解决方案

这是SikuliX的RaiMan( http:// sikulix .com



- 1.你目前使用的是1.0.1。我建议切换到版本1 1.1.0,因为这安装更平稳,特别是在Windows(没有路径条目或任何其他需要的)。
因为你想将你的应用程序部署到没有安装SikuliX的系统,这样会更容易。



- 2.如果你想运行你的应用程序在没有安装SikuliX的系统上,您必须将sikulixapi.jar(使用目标系统的安装程序创建)打包到应用程序jar(制作所谓的胖罐或uber jar)中,或允许人们下载一个现成的sikulixapi.jar在某个地方,并且在您的应用程序中注意,当您的应用程序运行时,sikulixapi.jar在类路径上。你的案例有什么意义,取决于你想要发布你的应用程序。



- 3.你说:应用程序在eclipse中工作正常,但是当我导出它作为可运行的jar ...
内部Eclipse它需要汽车,依赖的东西在类路径上。工作区中生成的jar是裸的,在运行时需要一个类路径。
有一个选项,将依赖的jar复制到工作区中的lib文件夹。如果你这样做,你的罐子会工作(虽然我不推荐这个:sikulix罐子不应该被移动,但只是以某种方式引用)



- 4.你说:没有catch块被触发,虽然我已经用catch(Exception ex)包围了代码。
如果从命令行运行你的jar说:

  java -jar myapp.jar 

它应该与一些无法匹敌的异常崩溃(最可能是找不到类)



如您所做,您可以直接与我联系,参考这篇文章。


I'm having a problem with the java library sikuli. First I downloaded the sikuli setup jar and executed it. It created sikuli-java.jar and a libs folder (under c:/documents/sikuli). After that I created a project in eclipse, added the jar to the build path and wrote the code. The code worked when I ran it in eclipse. After that I created a runnable jar from it. I ran the runnable jar. It closed when it hit the sikuli code.

I want to export the app as a runnable jar and deploy it, without the users need to install sikuli. Is this even possible?

Also: https://github.com/RaiMan/SikuliX-2014/wiki/Usage-in-Java-programming

take care, that sikulixapi.jar is in the Java classpath of your project

I don't even have a file called sikulixapi.jar.

=======================================

Maybe a quick note, I've created the sikuli-java.jar with option 4 and 6.

edit: Anyone? The application works fine in eclipse but when I export it as runnable jar and run it, as soon as it hits the sikuli stuff it closes. No catch block triggered, although I've surrounded the code with catch(Exception ex). I've configured eclipse like this: https://stackoverflow.com/a/10354759/2815780

解决方案

This is RaiMan from SikuliX (http://sikulix.com)

-- 1. You currently are using 1.0.1. I recommend to switch to version1 1.1.0, since this installs smoother especially on Windows (no path entry or anything else needed anymore). Since you want to deploy your app to systems not having SikuliX installed, this would make it easier.

-- 2. If you want to run your app on systems not having SikuliX installed, you have to pack a sikulixapi.jar (created with setup for the target system) into your application jar (make a so called fat jar or uber jar) or allow people to download a ready made sikulixapi.jar from somewhere and take care in your application, that sikulixapi.jar is on class path, when your app runs. What makes sense in your case, depends on how you want to publish your app.

-- 3. you say: The application works fine in eclipse but when I export it as runnable jar… Inside Eclipse it takes car, that dependent stuff is on class path. The jar produced in the workspace though is "naked" and need a class path at run time. There is an option, to copy the dependent jar to a lib folder in the workspace. If you do that, your jar will work (though I do not recommend this: sikulix jars should not be moved around but only referenced somehow)

-- 4. you say: No catch block triggered, although I've surrounded the code with catch(Exception ex). If you run your jar from command line saying:

java -jar myapp.jar

it should crash with some unmatched exception (most probably "class not found")

As you already did, you might contact me directly with reference to this post here.

这篇关于导出与Sikuli的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆