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

EclipseMavenM2eclipse

Eclipse Problem Overview


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 ConfigureConvert to Maven Project.

After adding this, a build error appeared in the Eclipse Problems view:

Java compiler level does not match the version of the installed Java project facet.
Unknown	Faceted Project Problem (Java Version Mismatch)

Please tell me how to resolve this error (I want to have my JRE version as 1.6 only).

Eclipse Solutions


Solution 1 - Eclipse

If your project is not a Maven project, right-click on your project and choose Properties to open the Project Properties dialog.

There is a Project Facets item on the left, select it, look for the Java facet on the list, choose which version you want to use for the project and apply.

Project Factes - Java version

Solution 2 - Eclipse

Assuming that you are using the m2e plugin in Eclipse, you'll need to specify the source and target versions as 1.6 for maven-compiler-plugin. m2e uses these values to determine the project's Java compiler level. A snippet of the POM is shown below:

<build>
  <plugins>
    <plugin>
      <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
    </plugin>
  </plugins>
</build>

Alternatively, you can specify the maven.compiler.source and maven.compiler.target properties with values of 1.6, that happen to be the equivalent:

<properties>
    <maven.compiler.target>1.6</maven.compiler.target>
    <maven.compiler.source>1.6</maven.compiler.source>
</properties>

Solution 3 - Eclipse

TK Gospodinov answer is correct even for maven projects. Beware: I do use Maven. The pom was correct and still got this issue. I went to "Project Facets" and actually removed the Java selection which was pointing to 1.6 but my project is using 1.7. On the right in the "Runtimes" tab I had to check the jdk1.7 option. Nothing appeared on the left even after I hit "Apply". The issue went away though which is why I still think this answer is important of the specific "Project Facets" related issue. After you hit OK if you come back to "Project Facets" you will notice Java shows up as version 1.7 so you can now select it to make sure the project is "marked" as a Java project. I also needed to right click on the project and select Maven|Update Project.

Solution 4 - Eclipse

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.

Solution 5 - Eclipse

I resolved this problem by setting the java version in Project Facet property of the project properties, Right click the project root folder -> Properties, search for Project Facets, and select compatible java version.

For reference -

enter image description here

Solution 6 - Eclipse

I changed the configuration inside workspace/project/.setting/org.eclipse.wst.common.project.facet.core to :

installed facet="jst.web" version="2.5"
installed facet="jst.java" version="1.7"

Before changing config, remove project from IDE. This worked for me.

Solution 7 - Eclipse

I resolved it by Myproject--->java Resource---->libraries-->JRE System Libraries[java-1.6] click on this go to its "property" select "Classpath Container" change the Execution Environment to java-1.8(jdk1.8.0-35) (that is latest)

Change the jdk to latest

Solution 8 - Eclipse

The Project Facet->Java should match whatever you have in the pom.xml for the maven-compiler-plugin artifact source and target.This is perfect.But if you donot have it here then you can also fix it by matching Java compiler version in Porject-Facets from the setting: Eclispe->Preferences->Java->Compiler

Solution 9 - Eclipse

You can change project facet from Project --> Properties --> Project Facet --> Java --> {required JDK version}

Solution 10 - Eclipse

Right click the project and select properties Click the java compiler from the left and change to your required version Hope this helps

Solution 11 - Eclipse

In Eclipse, right click on your project, go to Maven> Update projetc. Wait and the error will disappear. This is already configured correctly the version of Java for this project.

enter image description here

Solution 12 - Eclipse

If using eclipse,

Under.settings click on org.eclipse.wst.common.project.facet.core.xml

<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
  <installed facet="java" version="1.7"/>
</faceted-project>

Change the version to the correct version.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser974802View Question on Stackoverflow
Solution 1 - EclipseTK GospodinovView Answer on Stackoverflow
Solution 2 - EclipseVineet ReynoldsView Answer on Stackoverflow
Solution 3 - EclipseNestor UrquizaView Answer on Stackoverflow
Solution 4 - EclipsecmgharrisView Answer on Stackoverflow
Solution 5 - EclipsedeveloperickView Answer on Stackoverflow
Solution 6 - EclipseDheerajView Answer on Stackoverflow
Solution 7 - EclipseRishiKesh PathakView Answer on Stackoverflow
Solution 8 - Eclipseuser3925215View Answer on Stackoverflow
Solution 9 - EclipseAnant Laxmikant BobdeView Answer on Stackoverflow
Solution 10 - EclipseRaphaelView Answer on Stackoverflow
Solution 11 - EclipseDanilo LiraView Answer on Stackoverflow
Solution 12 - EclipseADLView Answer on Stackoverflow