//ToolUtil是当前类名称
Properties prop = new Properties();
try {
prop.load(ToolUtil.class.getClassLoader().getResourceAsStream("url-config.properties"));
Client.url = prop.getProperty("solr.url");
} catch (IOException e) {
e.printStackTrace();
}
//ToolUtil是当前类名称
Properties prop = new Properties();
try {
prop.load(ToolUtil.class.getClassLoader().getResourceAsStream("url-config.properties"));
Client.url = prop.getProperty("solr.url");
} catch (IOException e) {
e.printStackTrace();
}
本文标题:java项目根路径读取properties
本文链接:https://www.haomeiwen.com/subject/pylsmttx.html
网友评论