Open thinkuncle opened 7 years ago
InputStream ins = getClass().getResourceAsStream("/resource/dbconfig.properties");
PropertyConfigurator.configure(System.getProperty("user.dir") + "/resource/log4j.xml");
FileInputStream inputStream1 = new FileInputStream("out.properties");
InputStream inputStream2 = a.class.getResourceAsStream("/in.properties");
方法1
读取properties文件方法
log4j.xml 需要单独处理
方法二:
配置文件out.properties和jiar包在同一个目录下面:
配置文件in.properties在jar包内部: