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

转载自本人公众号:自动化测试    不只是技术                                             No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK
  1. 创建maven的时候报错,错误如下
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Test: Compilation failure
    [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? 

  2. 原因:eclipse中配置的java环境的目录,错误,把jdk的目录配置成了jre的目录。

  3. 解决方法:eclipse中,按照以下路径,Windows->Preferences,找到Java,点击Add,添加jdk的目录。

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


点击Add之后,点击下图Next

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


点击Directory

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


点击Directory之后,找到自己的jdk的按照目录,点击确定

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


选中jdk,点击OK。接下来再创建maven项目则不会报错。

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



推荐阅读:

运行自动化测试demo的前期配置一

人生第二十六个儿童节

转载自本人公众号:自动化测试    不只是技术                                            

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