How to pass parameters and VM arguments after bundling jar as exe with install4j

Viewed 266

I have used install4J and bundled my jar and files into an exe. It creates an exe with the name and when double clicked it opens up a swing window, which works as expected.

When this exe was a jar, it used to work in two different ways.

  1. Double click, and as there are no String args[] it used to open a swing window.

  2. Call it via java -jar test.jar -DFIX_RULES="true" -DTEST="false" C://TestMe C://TestMe2 as here we are passing arguments and -D args, it used to run as a service too.

How do I call exe with arguments now? Has any one done this?

1 Answers

To pass VM parameters to an executable generated by install4j you have to prefix them with -J, in your example:

your.exe -J-DFIX_RULES=true -J-DTEST=false C://TestMe 
Related