Java 获取当前jar包执行的路径

版权声明:Boomlee https://blog.csdn.net/BoomLee/article/details/83013920

1.应用根据需求来,直接上代码

//获取当前jar 的执行路径
            ApplicationHome home = new ApplicationHome(getClass());
            File jarFile = home.getSource();
            String parent = jarFile.getParent();
            System.out.println(parent);

猜你喜欢

转载自blog.csdn.net/BoomLee/article/details/83013920
今日推荐