Source: http://www.java2s.com/Tutorial/Java/0120__Development/SettingtheValueofaSystemPropertyfromtheCommandLineaddDoptiontothejavacommandwhenrunningyourprogram.htm
java -Dmy.prop="my value" MyApp public class Main { public static void main(String[] argv) throws Exception { String prop = System.getProperty("my.prop"); } }
No comments:
Post a Comment