在class中取得class目录的物理路径方法

String path=  this.getClass().getClassLoader().getResource("").getPath();
path=path.substring(1).replace("/","\\") ;
原文地址:https://www.cnblogs.com/yg_zhang/p/987086.html