Java Properties 加载

static{
    Properties prop = new Properties();
    prop.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("configure.properties"));
    String path = properties.getProperty("reportOutPutPath");
}

获得一个线程读取configure.properties

从加载的Properties文件中读取属性

String path = properties.getProperty("reportOutPutPath");

原文地址:https://www.cnblogs.com/yangchongxing/p/7642414.html