首页 > 代码库 > Java获取项目路径

Java获取项目路径

System.getProperty("user.dir") : E:\workspace\lucene
            class.getResource("") : /E:/workspace/lucene/target/test-classes/com/hbzx/lucene/
           class.getResource("/") : /E:/workspace/lucene/target/test-classes/
           class.getResource(".") : /E:/workspace/lucene/target/test-classes/com/hbzx/lucene/
   new File("").getAbsolutePath() : E:\workspace\lucene
   new File("/").getAbsolutePath(): E:\