欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Maven install打war包时报错No compiler is provided in this environment解决方法

程序员文章站 2022-05-24 19:58:03
...

在使用Maven install 打war包时报错如下:

[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

报错原因:Eclipse默认在公用jre上运行,maven install 编译需要jdk中的编译器,所以需添加JDK
操作步骤:
1、windows-preferences
Maven install打war包时报错No compiler is provided in this environment解决方法
2、然后依次点击Java——Installed JREs,可以看到目前使用的不是jdk中的JRE,然后点击Add
Maven install打war包时报错No compiler is provided in this environment解决方法
3、选择standard VM,next
Maven install打war包时报错No compiler is provided in this environment解决方法
4、点击Directory,选择jdk安装目录,然后点击确定
Maven install打war包时报错No compiler is provided in this environment解决方法
5、点击finish,可看到已添加jdk
Maven install打war包时报错No compiler is provided in this environment解决方法
Maven install打war包时报错No compiler is provided in this environment解决方法
6、选中添加的jdk,依次点击apply-OK
Maven install打war包时报错No compiler is provided in this environment解决方法
7、然后右键项目,依次点击build path-configure build path
Maven install打war包时报错No compiler is provided in this environment解决方法
8、依次点击Java Build path——Libraries——JRE System Library——Edit,在弹出框中选择新增的jdk并点击Finish。(完)
Maven install打war包时报错No compiler is provided in this environment解决方法

相关标签: war maven