打印java系统的信息

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
    }
}
posted @ 2020-07-20 22:36  錵開や落幕  阅读(207)  评论(0编辑  收藏  举报