问题说明

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. bypass disable_function

    windows 1.com组件绕过 <?php$command=$_POST['a'];$wsh = new COM('WScript.shell'); // 生成一个COM对象 Shell.A ...

  2. kafka监听出现的问题,解决和剖析

    问题如下: kafka为什么监听不到数据 kafka为什么会有重复数据发送 kafka数据重复如何解决 为什么kafka会出现俩个消费端都可以消费问题 kafka监听配置文件 一. 解决问题一(kaf ...

  3. spring aop 、Redis实现拦截重复操作

    一.问题:项目中有一些重复操作的情况,比如: 1.从场景有用户快速点击提交按钮,或者postMan测试时快速点击 2.从业务上来说,用户注册.用户下单等 3.黑客攻击 二.解决办法 1.使用sprin ...

  4. 【SDOI2013】JZOJ8月3日提高组T4 直径

    题目 题目描述 小 Q 最近学习了一些图论知识.根据课本,有如下定义. 树:无回路且连通的无向图,每条边都有正整数的权值来表示其长度.如果一棵树有 N 个节点,可以证明其有且仅有 N-1 条边. 路径 ...

  5. Spring Cloud Alibaba 初体验(二) Nacos 服务注册与发现 + 集成 Spring Cloud Gateway

    一.服务注册 添加依赖: <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>s ...

  6. 使用matpoltlib读取csv显示图表范例

    import os import numpy as np import matplotlib.pyplot as plt root = os.getcwd() list_data = [os.path ...

  7. 将Shiny APP搭建为独立的桌面可执行程序 - Deploying R shiny app as a standalone application

    目录 起源! 目的? 怎么做? 0 准备工作 1 下载安装R-portable 2 配置 Rstudio 3 搭建Shiny App 3.1 添加模块 3.2 写AppUI和AppServer 3.3 ...

  8. moviepy音视频开发:audio_normalize调整剪辑音量大小到正常

    ☞ ░ 前往老猿Python博文目录 ░ 概述 audio_normalize函数用于将一个剪辑的音量大小调整到正常,调整的思路就是将剪辑中音频帧数据的最大值取出来,当其值小于1时,表示剪辑的音量偏小 ...

  9. PyQt学习随笔:Model/View设计中支持View中展示数据的排序

    老猿Python博文目录 专栏:使用PyQt开发图形界面Python应用 老猿Python博客地址 在model/view架构中,有两种方法可以实现排序,选择哪种方法依赖于底层Model.如果mode ...

  10. 本地web项目部署到服务器里连接不上数据库的解决办法

    今天突然想到把自己之前的项目挂到服务器上,但是用到了数据库,于是给服务器装上了MySQL,想着能赶紧把项目挂上去看看效果,然后并不是一帆风顺,在奋斗了四小时后终于解决了问题的所在. (1)首先我找到了 ...