Get the system environment

ReturnMethodSummary
static Map<String,String>getenv()Returns an unmodifiable string map view of the current system environment.

public class Main {

  public static void main(String args[]) {
    System.out.println(System.getenv());

  }
}

The output:


{USERPROFILE=C:\Documents and Settings\abc, PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH, ANT_OPTS=-
Xmx1024m, JAVA_HOME=C:\Java_Dev\sdk\jdk, TEMP=C:\DOCUME~1\abc\LOCALS~1\Temp, SystemDrive=C:, ProgramFiles=C:\Program 
...
...
...
...
...
...


ComSpec=C:\WINDOWS\system32\cmd.exe, APPDATA=C:\Documents and Settings\abc\Application Data}
java2s.com  |  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.