java读取src同级目录下properties文件
如下:
Properties properties = new Properties();
try {
InputStream is = new BufferedInputStream(new FileInputStream("./conf/abc.properties"));
properties.load(is);
} catch (FileNotFoundException e1) {
e1.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
还没有评论,来说两句吧...