新建maven工程报错,maven配置jdk12问题

i徒步 2019-07-10 03:28:52
我的maven版本是3.6.1,JDK是12.0.1,新建maven工程后报如下错误:
Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment.

在网上查找资料,都说改pom.xml:
                  <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF8</encoding>
</configuration>
</plugin>
</plugins>


但我这里jdk版本是12.0.1,把这里的1.8替换成12、12.0.1、执行update project后,依然都报错。
请问这个怎么办?我刚学web,还请各位大神帮忙,谢谢。
...全文
228 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
jdk版本过高吧,建议使用jdk8,现在兼容性最强的版本
maradona1984 2019-07-12
  • 打赏
  • 举报
回复
建议直接安装jdk8
Monday_@@ 2019-07-12
  • 打赏
  • 举报
回复
Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment.f 翻译一下这句,你就可以得到上面两老高的答案了
kobe8free 2019-07-11
  • 打赏
  • 举报
回复
3.6.1 用jdk 1.8 也就行了白 window -> preferences->java->installed jres 更改 jdk路径
star19860411 2019-07-10
  • 打赏
  • 举报
回复
用的是eclipse吗 右键项目 properties-->java build path修改jre

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧