Dave's Brain

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

Date: 2012aug28
Language: Java

Q.  How can I dump the environment?


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); } }

Add a comment

Sign in to add a comment
Copyright © 2008-2018, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.