在class中取得class目录的物理路径方法 String path= this.getClass().getClassLoader().getResource("").getPath(); path=path.substring(1).replace("/","\\") ;