Monday, September 15, 2014

Java: Get system property from the command line

 
 
 
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