获取tomcat路径 System.getProperty(“catalina.home”); 获取项目所在路径 this.getClass().getClassLoader().getResource("/").getPath();