zoukankan      html  css  js  c++  java
  • Maven报错:“请使用 -source 7 或更高版本以启用 diamond 运算符”

    [INFO] Scanning for projects...
    [INFO]                                                                         
    [INFO] ------------------------------------------------------------------------
    [INFO] Building storm-kafka-test 1.0-SNAPSHOT
    [INFO] ------------------------------------------------------------------------
    [INFO] 
    [INFO] >>> maven-assembly-plugin:2.2-beta-5:assembly (default-cli) > package @ storm-samples >>>
    [INFO] 
    [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ storm-samples ---
    [WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
    [INFO] skip non existing resourceDirectory E:eclipseworkspaceCopy_storm-kafka-testsrcmain
    esources
    [INFO] 
    [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ storm-samples ---
    [INFO] Changes detected - recompiling the module!
    [WARNING] File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent!
    [INFO] Compiling 5 source files to E:eclipseworkspaceCopy_storm-kafka-test	argetclasses
    [INFO] -------------------------------------------------------------
    [ERROR] COMPILATION ERROR : 
    [INFO] -------------------------------------------------------------
    [ERROR] /E:/eclipse/workspace/Copy_storm-kafka-test/src/main/java/com/h3c/storm/PrivateHBaseBolt.java:[30,46] -source 1.5 中不支持 diamond 运算符
      (请使用 -source 7 或更高版本以启用 diamond 运算符)
    [INFO] 1 error
    [INFO] -------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 5.976 s
    [INFO] Finished at: 2016-07-08T10:57:52+08:00
    [INFO] Final Memory: 14M/159M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project storm-samples: Compilation failure
    [ERROR] /E:/eclipse/workspace/Copy_storm-kafka-test/src/main/java/com/h3c/storm/PrivateHBaseBolt.java:[30,46] -source 1.5 中不支持 diamond 运算符
    [ERROR] (请使用 -source 7 或更高版本以启用 diamond 运算符)
    [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

    编译版本出现了问题,在pom文件作如下修改

    <plugins> 
    <plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-compiler-plugin</artifactId> 
    <configuration> 
    <source>1.7</source> 
    <target>1.7</target> 
    </configuration> 
    </plugin> 
    </plugins>
  • 相关阅读:
    C++雾中风景16:std::make_index_sequence, 来试一试新的黑魔法吧
    神经网络中的降维和升维方法 (tensorflow & pytorch)
    论文翻译:2020_Residual Acoustic Echo Suppression Based On Efficient Multi-Task Convolutional Neural Network
    论文翻译:2018_Deep Learning for Acoustic Echo Cancellation in Noisy and Double-Talk Scenarios
    十分钟入门Apollo
    SpringSecurity实现OAuth2+JWT
    实现Vue的多页签组件
    原生redis命令
    .NET Core学习笔记(8)——Entity Framework Core之Database First
    函数极限的计算_计算机程序化实现的理论基础
  • 原文地址:https://www.cnblogs.com/zhengchunhao/p/5652947.html
Copyright © 2011-2022 走看看