← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #668304]: importing and running jar with swing gui: no main manifest attribute

 

Question #668304 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/668304

    Status: Open => Answered

RaiMan proposed the following answer:
You have to prepare the jar in a way, that it is runnable from command line:
java -jar C:\sikulli\KHv4.sikuli\configwindow.jar

To get this working, your jar needs a main class, that takes care to
show the window on the screen.

Look in the net for Java tutorials, how to run an app with awt/swing
components.

... but that is not all:
to use this "window" as a preset for some values needed inside your script later, you have to store the settings when the user has clicked ok (for example as a property file), so that you can access these values afterwards for your script.

... and you have to somehow wait for the user to click ok, since calling
subprocess simply detaches a new process in parallel, while your script
will continue to run.

... and this is not needed with your current concept:
# loading the jar file for the gui
load("C:\\sikulli\\KHv4.sikuli\\configwindow.jar")

since you do not access anything inside the jar in your script.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.