Java examples for Object Oriented Design:main method
Reading Environment Variables
public class Main { public static void main(String[] args) { if (args.length > 0) { String value = System.getenv(args[0]); if (value != null) { System.out.println(args[0].toUpperCase() + " = " + value); } else { System.out.println("No such environment variable exists"); } //from ww w . j a v a 2 s. c om } else { System.out.println("No arguments passed"); } } }