System.getProperties()
确定当前系统属性
Properties.list()
将获取到的信息打印到流中
public class Userone {
public static void main(String[] args) throws IOException {
System.getProperties().list(System.out);
// System.out.println(properties);
// properties.store(new FileWriter("D:\桌面\a.txt"),"Store"); //将信息输出到文件中去
// properties.list(System.out);
System.out.println(System.getProperty("user.name")); //获取用户名
System.out.println(System.getProperty("java.library.path")); //获取library.path
}
}