Chris Wood
Chris Wood

Reputation: 65

Java compiler level does not match the version of the installed Java project facet", but it does

I'm updating an ancient WebSphere 5 web appliction, porting it to run in Tomcat, replacing IBM RAD 7.0 with Eclipse Kepler, and using Maven for dependencies.

I am getting the "Faceted Project Problem (Java Version Mismatch)" error. The specific text is "Java compiler level does not match the version of the installed Java project facet.".

Here's where I've checked for compiler version:

  • I right-click on the project and select Properties. I click "Project Facets", and see my Java facet says 1.7.
  • I check the "Java Compiler" properties page (I'd like the "Enable project specific settings" box to remain unchecked, but it's checked and when I uncheck it, Maven->Refresh Project, and it's checked again.). The compiler version is grayed out, but it is also 1.7.
  • Window/Preferences/Java/Compiler is also 1.7, and the "Use default compliance settings" box is checked.
  • Windows/Preferences/Java/Installed JREs has both jdk1.7.0_71 (checked), and jre7 available.
  • pom.xml also says 1.7:

        <project xmlns="http://maven.apache.org/POM/4.0.0"   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
            <modelVersion>4.0.0</modelVersion>
            ...
            <build>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                    <configuration>
                        <source>1.7</source>
                        <target>1.7</target>
                    </configuration>
                </plugin>
            </plugins>
            ...
        </build>
    
        <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>org.opennms.core.snmp</groupId>
                    <artifactId>org.opennms.core.snmp.joesnmp</artifactId>
                    <version>0.2.6</version>
                </dependency>
            </dependencies>
        </dependencyManagement>
    </project>
    

  • Where am I setting a Java compiler level that "does not match the version of the installed Java project facet"?

    Upvotes: 0

    Views: 7941

    Answers (2)

    LS256
    LS256

    Reputation: 1

    I had similar case.. changing "Project Faces" brought no results. In my case helped right click on project -> properties -> java compplier and then uncheck option "use compliance from execution environemnt..." and choose your java version (in my case 1.8)

    Upvotes: 0

    Tarik
    Tarik

    Reputation: 5021

    I had a similar problem before that I resolved by modifying the eclipse.ini file to ensure Eclipse will run the appropriate JVM.

    This is what i added to eclipse.ini (you need to use your exact path to javaw.exe) before the -vmargs option:

    -vm
    C:/Program Files/Java/jdk1.7.0_71/bin/javaw.exe 
    

    Upvotes: 1

    Related Questions