how to pass parameters to a runnable jar ?

Asked by Laurent IZAC

When executed as a runnable jar with a command line like:
> java -jar myCompiledScript.jar myParam
It does not work: I get the following error :
[Error] given sikulix....jar not found: C:\Users\<user>\myParam

It seems that only -v (verbose mode) is accepted...

I also tried "--" as mentionned here : https://sikulix-2014.readthedocs.io/en/latest/faq/010-command-line.html#command-line-options-intention-provide-user-parameters-for-running-scripts

But with no success.

How can I provide parameter values to my compiled script ?

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Laurent IZAC
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

this works for me:

--- wrapped script
print sys.argv

--- run as
java -jar sikulixide.jar -r wrapped_script.jar -- parm parm1 "parm3 = 1"

--- prints
[u'/var/folders/pc/t43tqvr56xx7kxz3m6z5g4rw0000gn/T/sikulix17229118916186188772/jartest$py.class', u'parm', u'parm1', u'parm3 = 1']

Revision history for this message
Laurent IZAC (laurent-izac) said :
#2

Perfect. Thanks

And it also works exactly like with the source folder (with --args).
=> this way there is not even the need to generate a runnable jar; the simple jar works just fine.