Eclipse不会将JRE 8识别为大于JRE 5

Dav*_*e C 5 java eclipse java-8

我在我的机器上安装了Java 8,并用它启动了一个项目.但是,当我使用@Override注释时,代码以红色下划线,并Syntax error, annotations are only available if source level is 1.5 or greater出现错误.

我已经安装了已发布的Eclipse Java开发工具修补程序,支持Java 8(适用于Kepler SR2),但这只增加了对Java 8中新功能的支持,并且不修复注释错误.

Jig*_*shi 4

确保您的 INSTALLED_JRE 指向 eclipse 中的 jdk 1.8

Preference > java > installed_jre
Run Code Online (Sandbox Code Playgroud)

确保 java > 编译器在 eclipse 中设置为 1.8

preference > java > compiler > compiler compliance level 
Run Code Online (Sandbox Code Playgroud)