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
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
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.
Right click the project and select properties Click the java compiler from the left and change to your required version Hope this helps
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.
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>
You can change project facet from Project --> Properties --> Project Facet --> Java --> {required JDK version}