String path = getClass().getProtectionDomain().getCodeSource().getLocation().getPath();
获取jar包发布到服务器后的版本路径
String path = this.class.getProtectionDomain().getCodeSource().getLocation()
如果执行当前类.class会获取当前类绝对路径,,
如果打包成jar了,会获取当前jar的绝对路路径
|
|
暴躁的石榴 · 翻译 - Dolibarr ERP CRM ...· 3 月前 · |
|
|
不羁的饺子 · Debezium | Apache Flink· 3 月前 · |
|
|
讲道义的烈酒 · Debezium-JSON--流式计算 ...· 3 月前 · |
|
|
从容的大脸猫 · 零代码第三方数据接入 | TDengine ...· 3 月前 · |
|
|
迷茫的马克杯 · 从VBA中的范围中删除特殊字符开发者社区· 3 月前 · |
|
|
潇洒的茶壶 · LinearGradient class ...· 11 月前 · |
|
|
爱看球的哑铃 · Mathpix ...· 1 年前 · |
|
|
含蓄的大象 · 【黄亲国麒】黄麒Eros20240624个播 ...· 1 年前 · |
|
|
淡定的葡萄 · git push ...· 2 年前 · |
|
|
英勇无比的玉米 · Weird behaviour of ...· 2 年前 · |
|
|
暴躁的石榴 · 翻译 - Dolibarr ERP CRM Wiki 3 月前 |
|
|
不羁的饺子 · Debezium | Apache Flink 3 月前 |
|
|
迷茫的马克杯 · 从VBA中的范围中删除特殊字符开发者社区 3 月前 |