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();
		}

 

你可能感兴趣的:(Java)