// determine environment variables // can be run both as an application and as an applet. // See envSnoop.html import java.util.*; import java.applet.*; public class envSnoop extends Applet { public static void main ( String args[] ) { doit(); } public void init() { doit(); } private static void doit() { // get the complete list of properties and print them. Properties p = System.getProperties(); p.list(System.out); // here's how to access particular properties by name. System.out.println("user.name=" + System.getProperty("user.name")); System.out.println("user.home=" + System.getProperty("user.home")); } }