试图通过多个命令行参数的javaws启动应用程序? [英] Trying to pass multiple command line parameters to javaws launch application?

查看:1068
本文介绍了试图通过多个命令行参数的javaws启动应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到了这个类似的问题,但他们都没有能够帮助我解决我的问题。我一直在考虑一项要求能在多个命令行参数传递给我们推出使用自定义的Java应用程序。

I have seen similar questions about this but none of them have been able to help me resolve my issue. I have been given a requirement to be able to pass in multiple command line parameters to launch a custom Java application we use.

反正我已经尝试了这个命令,因为所有的文档可以找我说:

Anyway I have tried this command as all the documentation I can find says:

"javaws -open arg1 arg2 arg3 arg4 arg5 arg6 http://yadda/html/launch.jnlp"

我也尝试过的各种参数的数量和也注意到了-open确实获得通过作为参数ARG [0],但由于某种原因,它不会接受更多的参数。

I have also tried various numbers of parameters and did notice that the "-open" does indeed get passed in as parameter arg[0] but for some reason it will not accept more arguments.

其中的相关解决方案的说,只要你想,如下图所示,然后默认值都应该,如果没有提供参数使用,您可以添加多个参数的JNLP,但如果是那么就应该通过他们,而不是的默认值。这是真的吗?

One of the related solutions says you can add as many arguments as you want to the JNLP as shown below and then the defaults are supposed to be used if no arguments are provided, but if they are then it should pass them in instead of the defaults. Is this true?

<application-desc main-class="com.company.casd.core.MainClass">
    <argument>testARG1</argument>
    <argument>testARG2</argument>
    <argument>testARG3</argument>
    <argument>testARG4</argument>
    <argument>testARG5</argument>
    <argument>testARG6</argument>
</application-desc>

本地Java:结果
C:\\用户\\用户名> Java的版本结果
Java版本1.6.0_31结果
的Java(TM)SE运行时环境(建立1.6.0_31-B05)结果
Java的热点(TM)64位服务器VM(20.6建造-B01,混合模式)结果。

Local Java:
C:\Users\user>java -version
java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode)'

LinuxServer:〜#Java的版本结果
Java版本1.7.0结果
IcedTea的运行环境(建立1.7.0-B24)结果
的IcedTea 64位服务器VM(建设1.7.0-B24,混合模式)结果

LinuxServer:~ # java -version
java version "1.7.0"
IcedTea Runtime Environment (build 1.7.0-b24)
IcedTea 64-Bit Server VM (build 1.7.0-b24, mixed mode)

它可能是与不同​​版本的服务器从VS我的本地机器?还是有别的东西我失踪?

Could it have something to do with the different versions from server vs my local machine? Or is there something else I am missing?

任何帮助或援助将大大AP preciated!

Any help or assistance would be greatly appreciated!

谢谢!结果
乔希

Thanks!
Josh

推荐答案

如果您咨询的 的javaws 命令行页面,你可能会注意到它可以接受 [运行选项] [控制选项] &安培;如果你再往下看该页面的可用选项的definitiion,它应该成为很清楚,他们的完全无关应用说明提供的参数

If you consult the javaws command line page, you might notice it accepts either [run-options] or [control-options] & if you look further down the page to the definitiion of the available options, it should become quite clear that they are entirely unrelated to the arguments supplied in the application-desc.

不过,为什么你想运行在任何情况下,命令行JWS的项目?这是没有意义的。

But then, why are you trying to run a JWS project from the command line in any case? It makes no sense.

这篇关于试图通过多个命令行参数的javaws启动应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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