一:问题
今天编译maven 项目构建失败,提示内容如下:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project xxx: Fatal error compiling: 无效的目标发行版: 1.8 -> [Help 1]

二:解决方案
网上查了一下,大概知道了是编译配置的原因,版本不匹配。相关的pom文件配置部分如下:
<plugin>
  <artifactId>maven-compiler-plugin</artifactId>
  <configuration>
    <source>1.8</source>
    <target>1.8</target>
  </configuration>
</plugin>
需要的版本是1.8而我本地的jdk版本是:

java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

所以就去下载了下jdk1.8版本,然后更新~/.bash_profile中的配置(MAC机),java -version 输出信息:

OK ,So easy, 再重新回到IDEA,编译项目,然而问题居然没有解决!!

三:遇到的坑

问题依旧,然后我就以为是IDEA的配置问题,各种更新配置,搞得我都要尝试把版本写入配置文件的那种方法(百度可查到)了~

这时,我忽然发现了一个问题,IDEA的终端里,输出的JDK版本信息依旧没有更新:

Oh, my god! 什么情况,我再重新打开终端,发现输出的版本信息居然还是1.7的,难道是~/.bash_profile中文件的配置,只对当前终端生效??

这时,我发现了问题的所在,因为我的mac的终端并没有使用bash,而是装了zsh(相信眼尖的小伙伴在上个截图就看到了),所以我在第二步骤修改的,不应该是~/.bash_profile,而是,~/.zshrc,

然后更新生效,问题解决。

四:总结

1. 遇到这个问题,首先应该了解,是JDK版本的问题,先检查IDEA或其他IDE配置的项目JDK版本,如果是本机的版本,更新。

2. 如果安装了zsh或其他的一些shell,记得修改相应的文件,不要修改错误。

3. IDEA的Terminal在更新完配置后,需要关了重启,才更新。

4. 第一次写东西,内容格式多包涵,码字不易。这个问题,需要的坑大神小神,可能都不会遇到,各家的情况都不一样,仅供参考,不喜勿喷。

问题:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile)的更多相关文章

  1. maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project web_nanchang

    maven打包成war时,报错:Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default- ...

  2. Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (dist) on project hadoop-kms: An Ant BuildException has occured

    编译cdh版hadoop2.5.0出现的问题 系统: CentOs66 64位 JDK:1.7 Maven: 3.0.5 Protobuf: libprotoc 2.5.0 编译命令: mvn pac ...

  3. Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project LogTest: Compilation failure -> [Help 1]

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default ...

  4. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.3.1:

    security-sdk-1.0.jar已经存在于D:/secServerSDK-test/src/main/resources/lib下 报错如下: xxxxxx@xxxxxxxx /d/secSe ...

  5. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:create (default-cli) on project standalone-pom: Unable to parse configuration of 3: mojo org.apache.maven.plugins:

    问题: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:create (defau ...

  6. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.3.1:jar (default-jar) on

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.3.1:jar (default-jar) on ...

  7. maven install 报错Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project*****

    [ERROR]Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-co ...

  8. Maven Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean Failed to delete access_log

    I'm trying to run simple struts project using maven and tomcat. When I'm trying to exucute next goal ...

  9. 解决Failed to execute goal org.apache.maven.plugins

    1.Maven构建失败 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin: 2.3 . 2 :compile  ...

  10. Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile 解决办法

    Maven install失败 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (d ...

随机推荐

  1. 用ffserver实现rtsp服务器的实验笔记

    参考:https://blog.csdn.net/hoyjam1/article/details/51281679 建议配置文件:/etc/config/ffserver.conf Port 1053 ...

  2. 2019-ACM-ICPC-徐州站网络赛-M.Longest subsequence-从字符串s中找到一个最长子序列,使得其字典序严格大于t

    2019-ACM-ICPC-徐州站网络赛-M.Longest subsequence-从字符串s中找到一个最长子序列,使得其字典序严格大于t [Problem Description] ​ 从字符串\ ...

  3. Robot Framework--接口测试环境搭建

    1.安装requests库 (robotframework-requests依赖这个request http client) 执行pip install requests 2. 安装requestLi ...

  4. js 面向对象之构造器与工厂函数

    字面量模式声明一个对象实例 let m = {name: "lisi", age:15} m.constructor // ƒ Object() { [native code] } ...

  5. Jmeter+Selenium结合使用(完整篇)

    selenium登录后的cookie交接给接口结合使用 一.下载webdriver插件(包含谷歌和火狐驱动),安装好之后需重启jmeter 二.在配置元件中添加jp@gc - Chrome Drive ...

  6. Django Forms的错误提示

    1.error_messages={} 首先,在构建form表单时,可以用"error_messages={}"自定义错误信息,例如: # form.py 1 from djang ...

  7. redis默认端口6379以其名命名,是我孤陋寡闻了,是名性感美女(梅尔兹)

    阿莱西亚-梅尔兹Alessia Merz ,这位亚平宁半岛的性感女人,自从结婚之后就逐渐的淡出了人们的实现,曾经的尤文教母已经现在已经是两个孩子的母亲,但是最近的梅尔兹开始蠢蠢欲动,在相夫教子的同时, ...

  8. html5文件夹上传源码

    前段时间做视频上传业务,通过网页上传视频到服务器. 视频大小 小则几十M,大则 1G+,以一般的HTTP请求发送数据的方式的话,会遇到的问题:1,文件过大,超出服务端的请求大小限制:2,请求时间过长, ...

  9. 对象(面向对象、创建对象方式、Json)

    一.面向对象 面向过程:凡事亲力亲为,每件事的具体过程都要知道,注重过程 面向对象:根据需求寻找对象,所有的事都用对象来做,注重结果 面向对象特性:封装.继承.多态(抽象性) js是一门基于对象的语言 ...

  10. GitHub中PR(Pull request)操作

    1. 贡献代码: 贡献代码,通俗的说,就是自己修改了代码,希望合并到别人的Repository(仓库)中.将自己的智慧贡献给开源社区.下面将详细讲解步骤 1.1 第一步:fork 在GitHub社区闲 ...