报错:即方法是Java1.6才开始有的
File ->Project Structure->Project Settings -> Modules -> Language Level->选一个,如8,如7都可以
或者在pom.xml 添加:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.6.0</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build>