2017-05-24 23 views

回答

0

您可能只想为此使用JVM参数。

对于例如,你可以在你的代码中定义类似下面,其中你也定义默认值,JVM的参数:

String username = System.getProperty("username","defaultUser"); 
String password = System.getProperty("password","password"); 

现在通过使用-Dusername=sa -Dpassword=sa

命令行这些值传递
相关问题