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

摘要: 本文讲的是Description Resource Path Location Type Java compiler level does not match the version of the in解决方法__jdk, 今天使用maven的时候报这个错误 然后在网上查了,是jdk的版本不匹配, 可以修改如下几个地方 

原文地址:https://yq.aliyun.com/ziliao/245790

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

然后在网上查了,是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.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.0.2</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins>

这样就可以解决错误了

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

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

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

<?xml version="1.0" encoding="UTF-8"?> <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了

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值