The compiler compliance specified is 1.7 but a JRE 1.8 is used
The compiler compliance specified is 1.7 but a JRE 1.8 is used。
原因:你安装的jdk里面的jre 和你eclipse设置的jre 不同。
解决:法①window->preferences->Java->Installed JREs, 然后更改版本。
法②右键点击你建立的项目 >Properties>Java Compiler>将Compiler compliance level改为1.8 ,再点击Apply and close