Java获取当前路径(Linux+Windows)

Java获取当前路径(Linux+Windows)

获取当前路径(兼容Linux、Windows):

String curPath = System.getProperty("user.dir");
log.info("===========当前路径===========curPath:{}", curPath);
输出结果:===========当前路径===========curPath:/home/lizhm
posted @ 2023-05-10 08:57  整合侠  阅读(307)  评论(0编辑  收藏  举报