java获取jar包执行路径

时间:2021-09-05 21:32:31   收藏:0   阅读:34

参考:https://stackoverflow.com/questions/320542/how-to-get-the-path-of-a-running-jar-file

 

String path =  this.getClass().getProtectionDomain().getCodeSource().getLocation().getPath();
String decodedPath = URLDecoder.decode(path, "UTF-8");

原文:https://www.cnblogs.com/144823836yj/p/15228381.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!