java获取当前项目及类的路径方法
File f1 = new File(this.getClass().getResource("/").getPath());
File directory = new File("");//参数为空
URL xmlpath = new AccountManageController().getClass().getClassLoader().getResource("privateKey");
System.out.println("获取当前工程路径 "+System.getProperty("user.dir"));
猜你喜欢
转载自blog.csdn.net/qq_38114157/article/details/85070863
今日推荐
周排行