java获取运行的jar(class)文件的路径 String strURL = getClass().getProtectionDomain().getCodeSource().getLocation().getPath(); strURL = strURL.substring(0,strURL.lastIndexOf("/")); strURL += "/"