MAVEN错误:The compiler compliance specified is 1.8 but a JRE 12 is used

MAVEN错误:The compiler compliance specified is 1.8 but a JRE 12 is used

一、具体问题

1、Problems警告:The compiler compliance specified is 1.8 but a JRE 12 is used

意思是说你指定的编译器版本号为1.8,而你实际安装使用的JRE 12,如图所示:

二、解决方案

1、右键点击工程项目图标,选择弹出菜单的最底部的“Perproties”

2、在弹出的窗口中点击“Java Compiler”,在右侧的窗口中 JDK Compliance 一项中,不勾选;修改Compiler compliance level 后面的列表选择框中,将默认显示的1.8,修改为12,如图所示:

3、点击“Apply”,点击“Apply and Close”

4、警告信息消失,问题解决

5、如仍未解决,相应的同步修改 pom.xml 文件中的java版本号

修改前:<properties>1.8</properties>

修改后:<properties>12</properties>


转载:http://www.yiduhao.com/index.php/index/news/news_detail/id/86.html

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。