参考: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");