如何使用JNLP将命令行参数传递给应用程序? [英] How to use JNLP to pass command line arguments to the application?

查看:359
本文介绍了如何使用JNLP将命令行参数传递给应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序有一个JNLP包。
现在我需要将命令行参数传递给我的应用程序。
如何扩展我的JNLP文件以列出命令行参数?

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?

例如,我需要说 java main.class arg1 arg2 arg1 arg2 需要作为JNLP文件的一部分提及。

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.

推荐答案

查看 application-desc 元素,了解<$的更多详情c $ c>参数元素。


应用程序 element表示JNLP文件正在启动应用程序(而不是applet)。 ..

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

可以通过包含一个或多个嵌套的参数元素来为应用程序指定参数。 / em>
例如:

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>

这篇关于如何使用JNLP将命令行参数传递给应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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