错误:指定的编译器合规性是 1.8,但使用了 JRE 15

ali*_*r90 7 java eclipse compiler-errors

所以我在 eclipse 中收到错误消息“指定的编译器合规性是 1.8 但使用了 JRE 15”,当我尝试更改 Java 编译器时,eclipse 说When selecting 1.8 compliance, make sure to have a compatible JRE installed and activated(currently 15). Configure the 'Installed JREs' and Execution Environments, or change the JRE on the Java Build Path

当我进入 Java 构建路径时,JRE 是 1.8,而不是 15。之后我进入执行环境,看到 JavaSE - 15 是唯一在兼容的 JRE 框中具有[完美匹配]的版本,但如果我尝试添加 Java SE - 1.8,有一个新警告,类似于Build path specifies execution environment JavaSE - 1.8, there are no JREs installed in the workspace that are strictly compatible with this environment

之后,我不知道该怎么办......

WJS*_*WJS 11

在首选项中您是否看到类似这样的内容 -Windows->Preferences->Java->Installed JREs

在此输入图像描述

确保存在正确的 JRE,或者访问Windows->Preferences->Java->Compiler并确保您的合规性设置匹配。