1.使用文件流进行加载
InputStream is = new FileInputStream(new File("FILE--PACH"));
Properties prop = new Properties();
prop.load(is);
2.直接使用getResourceAsStream进行加载
InputStream is = Test.class.getResourceAsStream("FILE--PACH");
Properties prop = new Properties();
prop.load(is);
3.使用类加载器的方式
InputStream is = Test.class.getClassLoader().getResourceAsStream("FILE--PACH");
Properties prop = new Properties();
prop.load(is);