linux下获取当前项目路径用java编写
在Linux下,可以使用System.getProperty("user.dir")获取当前项目路径。以下是一个示例代码:
public class Main {
public static void main(String[] args) {
String projectPath = System.getProperty("user.dir");
System.out.println("当前项目路径:" + projectPath);
}
}
原文地址: https://www.cveoy.top/t/topic/ihqW 著作权归作者所有。请勿转载和采集!