得到当前运行目录的几种方式

        System.out.println(DBUtil.class.getClassLoader().getResource().getPath() + db.properties);
        System.out.println(Thread.currentThread().getContextClassLoader().getResource().toString());
        System.out.println(System.getProperty(user.dir));

猜你喜欢

转载自blog.csdn.net/howroad/article/details/88941591