maven No compiler is provided environment

下面介绍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. 7添加JDK路径以后必须把JDK把前面的框 勾上,否则还会出现错误。
  8. 8再次执行compile 或者 install 指令,编译成功。
    maven No compiler is provided environment
     
    END
  9. 转载原地址https://jingyan.baidu.com/article/6dad5075250734a123e36efa.html,保存后续查看!

猜你喜欢

转载自www.cnblogs.com/xiaozhaoboke/p/11202835.html