How to use JNLP to pass command line arguments to the application?
Asked Answered
I

1

9

I have a JNLP package for my application. Now I have the need to pass command line arguments to my application. How do I extend my JNLP file to list the command line arguments?

For instance, I need to say java main.class arg1 arg2 and the arg1 and arg2 need to be mentioned as part of JNLP file.

Isborne answered 2/1, 2013 at 3:45 Comment(0)
C
12

Look to the description of the application-desc Element for further details of the argument element.

The application element indicates that the JNLP file is launching an application (as opposed to an applet). ..

Arguments can be specified to the application by including one or more nested argument elements.
For example:

  <application-desc main-class="Main">
    <argument>arg1</argument>
    <argument>arg2</argument>
  </application-desc>
Caesaria answered 2/1, 2013 at 3:56 Comment(2)
Is there a way to pass arguments to installer-desc tags for installation JNLP files (which will not have application-desc)?Picul
@plusjeff You should ask that as a separate question.Caesaria

© 2022 - 2024 — McMap. All rights reserved.