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? 错误的解决办法。javascript

方法/步骤

 
  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?html

  5. 错误缘由是maven编译的须要JDK而不是JRE。

    eclipse 导航栏中 【Window】-->【Prefrences】-->【Java】-->【Installed JREs】java

  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,保存后续查看!
相关文章
相关标签/搜索