The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > java.lang  [58 examples] > System Properties  [3 examples]

e87. Setting the Value of a System Property from the Command Line

A system property can be set or overridden by specifying the -D option to the java command when running your program.
    java -Dmy.prop="my value" MyApp

    // Get the value of the system property
    String prop = System.getProperty("my.prop");
    // my value

 Related Examples
e86. Getting and Setting the Value of a System Property
e88. Listing All System Properties

See also: Arrays    Assertions    Classes    Commands    Numbers    Objects    Strings    Threads   


© 2002 Addison-Wesley.