java输出当前目录(获取当前路径)

        System.out.println(System.getProperty("user.dir"));
//windows 目录写法:
        String jsonData = new String(Files.readAllBytes(Paths.get("d:\\work\\test.json")));
        
//Linux目录写法
        String jsonData = new String(Files.readAllBytes(Paths.get("/home/blue/test.json")));

  

猜你喜欢

转载自www.cnblogs.com/v5captain/p/12791642.html