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 Configure ? Convert 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).
Right click the project and select properties Click the java compiler from the left and change to your required version Hope this helps
I found @bigleftie's comment above very helpful: "Four things must match
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.
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.
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.
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
You can change project facet from Project --> Properties --> Project Facet --> Java --> {required JDK version}
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.
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.
Source: Stackoverflow.com