This commit is contained in:
bwcx_jzy 2021-08-03 12:01:09 +08:00
parent 7232f50df6
commit 46d4659b75

View File

@ -214,16 +214,9 @@ public class JpomManifest {
*/
public static File getRunPath() {
URL location = ClassUtil.getLocation(JpomApplication.getAppClass());
try {
URLConnection urlConnection = location.openConnection();
if (urlConnection instanceof JarURLConnection) {
JarURLConnection jarURLConnection = (JarURLConnection) urlConnection;
return FileUtil.file(jarURLConnection.getJarFile().getName());
}
return FileUtil.file(location.getFile());
} catch (Exception e) {
throw new RuntimeException(e);
}
String file = location.getFile();
String before = StrUtil.subBefore(file, "!", false);
return FileUtil.file(before);
}
/**