Java compiler level does not match the version of the installed Java project facet

后端 未结 12 1699
不知归路
不知归路 2020-12-07 07:19

I have created a New Dynamic Project under Eclipse Helios Version, where my JRE Version is set to 1.6. I have added Maven capabilities to the Web Application by clicking on

12条回答
  •  没有蜡笔的小新
    2020-12-07 08:03

    I found @bigleftie's comment above very helpful: "Four things must match

    1. Project->Java Build Path->Libraries->JRE version
    2. Project->Java Compiler-> Compiler Compliance Level
    3. Project->Project Facets->Java->Version
    4. (if using Maven) pom.xml - maven-compiler-plugin artefact source and target".

    In my case, in the project properties, Java compiler, the JDK compliance was set to use the workspace settings, which were different from the java version for the project. I clicked on 'Configure Workspace Settings', and changed the workspace Compiler compliance level to what I wanted, and the problem was resolved.

提交回复
热议问题