Trying to pass multiple command line parameters to javaws launch application?

╄→尐↘猪︶ㄣ 提交于 2019-12-22 08:43:13

问题


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"

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.

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>

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 -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)

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

Any help or assistance would be greatly appreciated!

Thanks!
Josh

来源:https://stackoverflow.com/questions/10606183/trying-to-pass-multiple-command-line-parameters-to-javaws-launch-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!