问题说明

Eclipse导入Maven项目后,执行 mvn clean install后,出现如下错误:

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project myproject: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

大致阅读了一下,说的是执行编译失败,你是不是在JRE环境下运行而不是JDK?闹闹头想了想,JDK已安装、各种环境变量配置木有问题,为什么会出现这种状况呢?寻思了一会儿,知道了原来Eclipse运行是需要一个JRE,而这个JRE并不是系统环境变量中的javac目录下的JRE,而是JDK安装时候自带的JRE目录,此目录下并无javac,故无法进行java的编译,问题找到了,下面说一下具体解决方案。

解决方案

在Eclipse的菜单中,进入 Window > Preferences > Java > Installed JREs > Execution Environments,选择JavaSE-1.x, 在右侧选择JDK的安装目录(注意不要选择JRE的目录).
 no-jdk

然后,进行maven install的时候就会找得到javac了。

Eclipse中,No compiler is provided in this environment. Perhaps you are running on a JRE rather than a的更多相关文章

  1. Maven No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? 问题

    maven编译项目时出错,提示信息如下: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3 ...

  2. No compiler is provided in this environment. Perhaps you are running on a JRE ra

    No compiler is provided in this environment. Perhaps you are running on a JRE ra,有需要的朋友可以参考下. 控制台输出的 ...

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

    以前用MyEclipse,现在用eclipse配置maven后,运行run install.报错: [ERROR] No compiler is provided in this environmen ...

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

    maven install项目时出错,提示信息如下: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-pl ...

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

    maven编译项目时出错,提示信息如下: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3 ...

  6. Maven异常: 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 JD ...

  7. 【maven】maven的web项目打包报错: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 ...

  8. Maven错误:[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?的解决方法

    错误: [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather tha ...

  9. No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? idea maven 打包报错问题解决

    mvn clean install -X -Dmaven.test.skip=true -P dev 打包报错:No compiler is provided in this environment. ...

随机推荐

  1. CenOS下监控工具尝试

    Cacti cacti重图形,有数据历史,需要用到数据库支持,支持web配置,默认不支持告警,可以加插件. Server端配置 安装epel yum install -y epel-release 安 ...

  2. CentOS硬软链接

    硬软链接说明 软链接: 1.软链接,以路径的形式存在.类似于Windows操作系统中的快捷方式 2.软链接可以 跨文件系统 ,硬链接不可以 3.软链接可以对一个不存在的文件名进行链接 4.软链接可以对 ...

  3. markdown详细

    在写博客时,想设置字体 颜色参照[(https://blog.csdn.net/wo919191/article/details/84249531)] 图片参照 背景色: gray

  4. Django 2版本

    django2.0里面的path第一个参数不支持正则,你写什么就匹配,100%精准匹配 django2.0里面的re_path对应着django1.0里面的url 虽然django2.0里面的path ...

  5. Django的model.py

    什么是ORM? 对象关系映射 类 >>> 表 对象 >>> 表记录 对象的属性 >>> 一条记录某个字段对应的值 django的orm不能够自动帮 ...

  6. 掌握 Promise 的逻辑方法

    Promise 是 ES2015 新增的对象 Promise 对象有几个组合方法,可以将多个承诺合并成一个进行处理 分别是 Promise.all, Promise.race, Promise.all ...

  7. java并发编程实战《八》管程

    管程:并发编程的万能钥匙 为什么 Java 在 1.5 之前仅仅提供了 synchronized 关键字及 wait().notify().notifyAll() 这三个看似从天而降的方法? Java ...

  8. 转:为什么说Python是最值得学习的编程语言

    老猿作为一个老程序员,研究生毕业后就没有这么用心的学过一门新的语言,而今年4月开始学Python以来,疯狂的迷上了它,有时很想写一篇为什么要学Python的文章,可一直懒没动笔,今天看到博友" ...

  9. 第10.11节 Python模块和包小结

    Python的模块就是一个独立的Python文件,Python的包是一些功能相关的Python文件放到一个目录下进行统一管理的文件管理结构,包本质上是模块,加载包就是加载包下特定的模块文件__init ...

  10. sql绕过小技巧

    两个空格代替一个空格,用Tab代替空格,%a0=空格: %20 %09 %0a %0b %0c %0d %a0 %00 /**/ /*!*/ 最基本的绕过方法,用注释替换空格: /* 注释 */ 使用 ...