`

Retrieve environment variables (JDK1.5)

    博客分类:
  • Java
XP 
阅读更多
<!---->

Retrieve environment variables (JDK1.5)

JDK1.5
System.getenv() is back!

import java.util.*;

public class Test {
 public static void main(String args[]) {
   // just one
   System.out.println("PATH = " + System.getenv("PATH"));

   // all of them
   Map env = System.getenv();
   for (Iterator it=env.entrySet().iterator(); it.hasNext(); ) {
      Map.Entry entry = (Map.Entry)it.next();
      System.out.println(entry.getKey() + " = " + entry.getValue());
    }
 }
}

See also this HowTo .

See this Howto for common XP environment variables

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics