zoukankan      html  css  js  c++  java
  • maven 启动 报错 Fatal error compiling: 无效的目标发行版

    错误内容如下
    ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project nutzbook: Fatal error compiling: 无效的目标发行版: 1.8 -> [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/MojoExecutionException
    
    Fatal error compiling: 无效的目 标发行版
    

    问题原因:jdk环境和maven配置的jdk不一样
    可将pom.xml文件中的jdk环境修改为maven配置

    修改pom.xml方式如下:

      <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
      </properties>
    

    或者为

    <build>  
        <plugins>  
            <plugin>  
                <groupId>org.apache.maven.plugins</groupId>  
                <artifactId>maven-compiler-plugin</artifactId>  
                <version>2.0.2</version>  
                <configuration>  
                    <source>1.8</source>  
                    <target>1.8</target>  
                </configuration>  
            </plugin>  
        </plugins>  
    </build> 
    
  • 相关阅读:
    c# 创建多线程
    使用opencvsharp通过mvvm在image中显示图片
    c# 创建文件/文件夹对话框
    wpf MVVM框架基础
    wpf DataBinding
    layui自动点击下拉列表的一项并选中
    LayUI默认样式调整
    mysql取某个组的前n条数据
    Kali3.0系统切换中文
    JS触发某元素周围元素的样式改变
  • 原文地址:https://www.cnblogs.com/exmyth/p/15587818.html
Copyright © 2011-2022 走看看