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

查看:28
本文介绍了如何使用 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 arg2arg1arg2 需要作为 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 元素,了解 argument 元素的更多细节.

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

application 元素表示 JNLP 文件正在启动应用程序(与小程序相反)...

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

可以通过包含一个或多个嵌套的 argument 元素为应用程序指定参数.
例如:

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天全站免登陆