就两句代码 String filepath = System.getProperty("user.dir")+"/a.xlsx"; File file=new File(filepath); 例子: 结果: 相关文章: