获取java根目录,加载根目录下的文件时间:2024-03-09 09:58:57 就两句代码 String filepath = System.getProperty("user.dir")+"/a.xlsx"; File file=new File(filepath); 例子: 结果: