1、项目右键 -> Properties 2、Java Build Path -> jdk -> Edit -> ok 3、Java Compiler -> 1.8 -> ok 4、Project Facets -> √ -> ok