File f = new File(this.getClass().getResource("/").getPath()+"xxx.properties");
try( FileInputStream d=new FileInputStream(f)) {
Properties properties=new Properties();
properties.load(d);
System.out.println(f.toString());
System.out.println(properties.getProperty("com.outpupath"));
} catch (IOException e) {
e.printStackTrace();
}
配置文件在resource文件下
内容
com.outpupath=E:/x/xxxx.xlsx
来源:https://www.cnblogs.com/funkboy/p/12299119.html