java获取项目跟路径

File directory = new File("");// 参数为空
String courseFile = directory.getCanonicalPath();
System.out.println("********");
System.out.println(courseFile);
原文地址:https://www.cnblogs.com/lxz123/p/15180063.html