获取java项目 classpath目录

mac2022-06-30  23

this.getClass().getResource("/").getPath();

 从根目录获取载入文件:

this.getClass().getResourceAsStream("/myshop.properties")

 

转载于:https://www.cnblogs.com/DajiangDev/p/3777539.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)