print Environment - Java java.lang

Java examples for java.lang:System

Description

print Environment

Demo Code


//package com.java2s;
import java.util.Map;

public class Main {
    public static void main(String[] argv) throws Exception {
        printEnvironment();//from   w ww  .  j a  va  2  s  .  co  m
    }

    public static void printEnvironment() {
        Map<String, String> env = System.getenv();
        for (String key : env.keySet()) {
            System.out.println(key.toString() + ":\n\t'" + env.get(key)
                    + "'");
        }
    }
}

Related Tutorials