LoginSignup
0
0

More than 3 years have passed since last update.

vscodeのjavaデバッグ時にパラメーターを渡す。[メモ書き]

Posted at

vscodeのjavaデバッグ時にパラメーターを渡す。[メモ書き]
java言語に限らずだけども、vscodeのデバッグ設定ファイルに下記の項目を追加する(※args)。

launch.json
        {
            "type": "java",
            "name": "Debug (Launch) - Current File",
            "request": "launch",
            "mainClass": "${file}",
            "args": [ 
                "あいうえお",
                "カキクケコ"
            ]
        },

下記で試す

demojava/demo4/Parameter.java
package demojava.demo4;

public class Parameter {
    public static void main(String[] args) {
        System.out.println(args[0] + "::" + args[1] );
    }
}

試した結果
2020-10-10_14-30-24.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0