1.将文件放入resources目录下面,将文件设置成resources file->Project Structure->Modules 选择文件,然后点击resources 2.在类中加入代码 val properties = new Properties()val in = this.getClass().getClassLoader().getResourceAsStream("my.properties");properties.load(in) 相关文章: