args[0]を出力するだけのプログラムを書きました。メインに引数が渡されない場合は、「HelloWorld」が出力されます。
class test {
public test(String str) {
System.out.println(str);
}
public static void main(String[] args){
if (args == null || args.length == 0) {
args = new String[] { "Hello World" };
}
new test(args[0]);
}}
.jnlpファイルでは、対応する部分は次のように記述されます。
<application-desc main-class="test"/>
<argument>TEST1</argument>
</application-desc>
ただし、このjnlpを実行すると、「HelloWorld」が出力されます。
誰かが私が理由を理解するのを手伝ってくれますか?