1.Project Structure of Project SDK select 1.8, Project language level selection 8
In 2.Project Structure Modules, select the language level 8
java compiler 3.setting in, project bytecode version and select Target bytecode version 1.8
Other methods:
Maven configuration
<!--控制项目的language level和compile 版本--> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin>