Browse - Programming Tips - How can I dump the environment?

Date: 2012aug28
Language: Java

Q.  How can I dump the environment?

A.

import java.util.Map; import java.lang.System; void dumpEnv() { final Map<String,String> env = System.getenv(); System.out.println("--- Environment ---"); for (String key : env.keySet()) { String val = env.get(key); System.out.println(key + "=" + val); } }