Java-列出所有系统属性

package com.tj;

import java.util.Enumeration;
import java.util.Properties;

public class MyClass implements Cloneable {
    public static void main(String[] args) {
        //获得所有的系统属性
        Properties props = System.getProperties();

        //所有的枚举类型系统属性
        Enumeration e = props.propertyNames();
        for (; e.hasMoreElements();) {
            //获取属性名称
            String propName = (String) e.nextElement();
            //获取属性值
            String propValue = props.getProperty(propName);
            System.out.println("name=" + propName + "	" + propValue);
        }
    }
}
原文地址:https://www.cnblogs.com/linma/p/3672897.html