0

我在 Eclipse 中做了一个 jar 并将它从 jsmooth 转换为 exe。exe已创建,但如果我双击它,它会立即关闭。我的代码有问题吗?

public class plz {

    public static void main(String[] args) {
        // TODO Auto-generated method stub

        System.out.println("Hello World!");
        for(int i = 0; i< args.length; i++) {
            System.out.format("args[%d}: %2 %n", i, args[i]);
        }

    }
}
4

1 回答 1

1

是的。您的代码声明它应该遍历参数列表(您在启动应用程序时提供)。完成后,应用程序将停止。

于 2020-10-14T10:06:09.523 回答