02 packageName = packageName.replace("/", "\\");
03 System.out.println("包名:"+packageName);
04 String projectPath = null;
05 try {
06 String packageFullName = GetPath.getPathFromClass(this.getClass());
07 projectPath = packageFullName.substring(0,
08 packageFullName.indexOf(packageName) + 1);
09 System.out.println("工程路径:"+projectPath);
10 } catch (IOException e1) {
11 projectPath = null;
12 e1.printStackTrace();
13 }
作者“双子座的博客”