Setting the Value of a System Property from the Command Line: add -D option to the java command when running your program.
java -Dmy.prop="my value" MyApp public class Main { public static void main(String[] argv) throws Exception { String prop = System.getProperty("my.prop"); } }