一:问题
今天编译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. MySQL 数据库的高可用性分析

    MySQL数据库是目前开源应用最大的关系型数据库,有海量的应用将数据存储在MySQL数据库中.存储数据的安全性和可靠性是生产数据库的关注重点.本文分析了目前采用较多的保障MySQL可用性方案. MyS ...

  2. ubuntu 启动图形界面 sudo init 5

    Linux系统最早期的时候只有命令行界面,所有的工作都需要用Linux命令来完成. 随着系统的发展,以及图形界面系统的出现,Linux也出现了图形界面,使得Linux系统不再是只有计算机的专业人士才可 ...

  3. urlrewrite与struts2结合使用基本配置

    1.更改web.xml,,,在struts2拦截器前面添加urlrewrite配置信息,,默认是forward的 <filter> <filter-name>UrlRewrit ...

  4. django安装tinymce

    1. pip install django-tinymce 2. 运行:python manage.py collectstatic 3. 编辑 settings.py 4. TINYMCE_JS_U ...

  5. Python3入门与进阶【笔记】

    1.二.八.十六进制转十进制:int('10', base=2).int('10', base=8).int('10', base=16): 2.八.十.十六进制转二进制:bin(0o+xxx).bi ...

  6. Codeforces Round #597 (Div. 2) A. Good ol' Numbers Coloring

    链接: https://codeforces.com/contest/1245/problem/A 题意: Consider the set of all nonnegative integers: ...

  7. Moq练习

    本文参考 http://www.cnblogs.com/haogj/archive/2011/06/24/2088788.html Moq适合于TDD的项目,小项目初期应该不太适合使用,有些浪费时间了 ...

  8. QT5 文件读写操作

    QFile Class 1.read读文件 加载文件对象  QFile file("文件地址"); 打开加载的文件file.open(打开方式); 操作文件 关闭打开的文件file ...

  9. VsCode安装Go的相关插件

    今天在学习Go的时候,安装Go的相关插件,显示安装不上,但是右下角也一直会提示让你安装,当然你可以设置成忽略,为了开发效率,我选择了安装.然后出现了问题,一直Failed.在网上看到了很多的文章,不是 ...

  10. 特征工程学习01-sklearn单机特征工程

    特征工程学习01-sklearn单机特征工程 小书匠 kindle  0.数据的导入 from sklearn.datasets import load_iris  #导入IRIS数据集  iris= ...