public File getClassRootDir(Class classz){ String filePath = classz.getProtectionDomain().getCodeSource().getLocation().getFile(); return new File(filePath); } public File getJarFile(Class classz){ String filePath = classz.getProtectionDomain().getCodeSource().getLocation().getFile(); return new File(filePath); }
获取类根路径及jar包路径
猜你喜欢
转载自java12345678.iteye.com/blog/2301361
今日推荐
周排行