版权声明:Boomlee https://blog.csdn.net/BoomLee/article/details/83013920
1.应用根据需求来,直接上代码
//获取当前jar 的执行路径
ApplicationHome home = new ApplicationHome(getClass());
File jarFile = home.getSource();
String parent = jarFile.getParent();
System.out.println(parent);