The GetProperty Example
import java.security.*;
class GetProperty { public static void main(String[] args) { try { if (args.length > 0) { String s = System.getProperty(args[0],"name " + args[0] + " not specified"); System.out.println(args[0] + " property value is: " + s); } else { System.out.println("Property name required"); } } catch(Exception e){ System.err.println("Caught exception " + e.toString()); } } } |