你的inputFile加上路径 FileInputStream inputFile = new FileInputStream("main/resources/constants.properties");