Description Resource Path Location Type Java compiler level does not match the version of the in解决方法

今天使用maven的时候报这个错误
Description Resource Path Location Type Java compiler level does not match the version of the in解决方法_第1张图片

然后在网上查了,是jdk的版本不匹配,
可以修改如下几个地方

解决方法 1:

我使用的jdk是1.8

windows—proferences—java–compiler设置jdk为1.8

windows—proferences—java–Installed JREs设置jdk为1.8

点击项目右键–properties—java Compiler 设置jdk为1.8

点击项目右键–properties—eclipse—project Facets设置java为1.8

点击项目右键–properties—eclipse—project Facets设置Dynamic Web Module 为3.1(这是你在web.xml配置的servlet版本)

点击项目右键–Maven—update project 错误应该可以消除

如果还是不行你就在pom.xml里面的

<plugins>
     <plugin>  
            <groupId>org.apache.maven.pluginsgroupId>  
            <artifactId>maven-compiler-pluginartifactId>  
            <version>2.0.2version>  
            <configuration>  
                <source>1.8source>  
                <target>1.8target>  
            configuration>  
        plugin>  
    plugins>

这样就可以解决错误了

解决方法 2:修改安装目录中的..\apache-maven-3.3.9\conf中的settings.xml中修改jdk版本
在profiles节点中添加

<profile>  
    <id>jdk-1.8id>  
     <activation>  
          <activeByDefault>trueactiveByDefault>  
          <jdk>1.8jdk>  
      activation>  
<properties>  
<maven.compiler.source>1.8maven.compiler.source>  
<maven.compiler.target>1.8maven.compiler.target>  
<maven.compiler.compilerVersion>1.8maven.compiler.compilerVersion>  
properties>  
profile>   

如果还是不行就到项目存放的地方我的是F:\eclipse\workspace\seckill.settings修改org.eclipse.wst.common.project.facet.core.xml这个文件


<faceted-project>
  <fixed facet="wst.jsdt.web"/>
  <installed facet="jst.web" version="3.1"/>
  <installed facet="wst.jsdt.web" version="1.0"/>
  <installed facet="java" version="1.8"/>
faceted-project>

修改 installed facet=”jst.web” version=”3.1”/为3.1
installed facet=”java” version=”1.8”/>为1.8

这样就OK了

你可能感兴趣的:(Description Resource Path Location Type Java compiler level does not match the version of the in解决方法)