Java是否等效于C#的Environment.GetCommandLineArgs()? [英] Does Java have an equivalent to C#'s Environment.GetCommandLineArgs()?

查看:68
本文介绍了Java是否等效于C#的Environment.GetCommandLineArgs()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我可以在 main方法中获取命令行参数,但是我需要能够间接获取它们。

I know that I can get the command-line arguments in the "main" method, but I need to be able to get them indirectly.

感谢您的帮助。

推荐答案

以下表达式正是您想要的:

Following expression is exactly what you want:

System.getProperty( sun.java.command)

System.getProperty("sun.java.command")

这篇关于Java是否等效于C#的Environment.GetCommandLineArgs()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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