通过类的加载器的方法getResourceAsStream()InputStream stream = getClass() .getClassLoader() .getResourceAsStream("defult.properties");