import java.util.Map;
//显示所有操作系统 环境变量
public class EnvironmentVariables {
public static void main(String[] args) {
for(Map.Entry entry : System.getenv().entrySet()){//System.getenv()返回一个map类型
System.out.println(entry.getKey()+" : "+entry.getValue());
}
}
}
转载于:https://www.cnblogs.com/lichone2010/p/3161731.html