下面介绍eclipse maven操作正常出现的No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? 错误的解决办法。
1.eclipse maven操作右击Run as 都能看到,如图所示

2.maven clean 操作主要目的是清除target目录下以前编译生成的文件及jar包

3.右击-->Run as --> maven build 会弹出一个框,输入compile或install命令都可以,编译项目。通过run 执行命令

4.可能会出现如下错误:
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

5.错误原因是maven编译的需要JDK而不是JRE。
eclipse 导航栏中 【Window】-->【Prefrences】-->【Java】-->【Installed JREs】

6.上一步出现的框里点击添加--->【Standard VM】---> 选择JDK的安装目录确定。

7.添加JDK路径以后必须把JDK把前面的框 勾上,否则还会出现错误。

8.再次执行compile 或者 install 指令,编译成功。

原文:https://jingyan.baidu.com/article/6dad5075250734a123e36efa.html
407




被折叠的 条评论
为什么被折叠?



