score:149

Accepted answer

did you check your project properties -> project facets panel? (from that post)

a wtp project is composed of multiple units of functionality (known as facets).

the java facet version needs to always match the java compiler compliance level.
the best way to change java level is to use the project facets properties panel as that will update both places at the same time.

wtp

the "project->preferences->project facets" stores its configuration in this file, "org.eclipse.wst.common.project.facet.core.xml", under the ".settings" directory.

the content might look like this

<?xml version="1.0" encoding="utf-8"?>
<faceted-project>
  <runtime name="websphere application server v6.1"/>
  <fixed facet="jst.java"/>
  <fixed facet="jst.web"/>
  <installed facet="jst.java" version="5.0"/>
  <installed facet="jst.web" version="2.4"/>
  <installed facet="jsf.ibm" version="7.0"/>
  <installed facet="jsf.base" version="7.0"/>
  <installed facet="web.jstl" version="1.1"/>
</faceted-project>

check also your java compliance level:

java compliance level

score:0

in spring sts, right click the project & select "open project", this provision do the necessary action on the background & bring the project back to work space.

thanks & regards vengat maran

score:0

i encountered this issue while running an app on java 1.6 while i have all three versions of java 6,7,8 for different apps.i accessed the navigator view and manually removed the unwanted facet from the facet.core.xml .clean build and wallah!

<?xml version="1.0" encoding="utf-8"?>

<fixed facet="jst.java"/>

<fixed facet="jst.web"/>

<installed facet="jst.web" version="2.4"/>

<installed facet="jst.java" version="6.0"/>

<installed facet="jst.utility" version="1.0"/>

score:21

the project facets should be derived automagically by the m2eclipse plugin from the pom configuration. if you make some changes to the pom and need eclipse to take them into account, right-click on your project, then go to maven > update project configuration. you should not set project facets manually.

score:44

you have two options to fix the issue:

1- manually make sure the two versions match.
2- use the ide's help as follows:
- right mouse click on the error in the 'problems' view
- select the 'quick fix' menu item from the pop-up menu
- select the right compiler level in the provided dialog and click 'finish'.

taken from eclipse: java compiler level and project facet mismatch

also gives location of where you can access the java compiler and facet version.


Related Query

More Query from same tag