java项目中的路径整理

获取该项目的classpath根路径

String classpath = Demo.class.getResource("/").getPath();
或
String classpath = this.getClass().getResource("/").getPath();

猜你喜欢

转载自blog.csdn.net/Michael_lcf/article/details/99886325