Thursday, February 26, 2015

Java get system environment variable details

Get System environment variable details.

import java.util.Map;

/**
 *
 * @author Uttesh Kumar T.H.
 */
public class FindJdk {

    public static void main(String[] args) {
        Map<String, String> env = System.getenv();
        for (String envName : env.keySet()) {
            System.out.format("%s=%s%n",envName,env.get(envName));
        }
    }
}


0 comments:

Post a Comment