方式一:获取运行jar目录
ApplicationHome home = new ApplicationHome(getClass()); File jarFile = home.getSource();
jarFile.getParentFile().toString()
方式二:获取jar内部目录
String basePatha1 = ClassUtils.getDefaultClassLoader().getResource("").getPath();
basePatha1 = URLDecoder.decode(basePatha1, "utf-8");