import java.util.Properties;
import java.util.Set;
public class Test
{
//通过System.getProperties()获取系统参数
public static void main(String[] args)
{
Properties sysProperties = System.getProperties();
Set<Object> keys = sysProperties.keySet();
for (Object key : keys)
{
System.out.print((String)key);
System.out.print(":");
System.out.println(sysProperties.getProperty((String)key));
}
}
}
Java获取当前系统属性
最新推荐文章于 2021-03-10 03:57:35 发布