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>
  • 相关阅读:
    模板 快速询问GCD
    Educational Codeforces Round 13 A. Johny Likes Numbers 水题
    Codeforces Round #102 (Div. 1) A. Help Farmer 暴力分解
    CDOJ 1402 三角形棋盘上的博弈游戏 状压DP
    CDOJ 1401 谭爷的黑暗沙拉 数学
    Bootstrap3.0学习第七轮(按钮)
    Bootstrap3.0学习第六轮(表单)
    Bootstrap3.0学习第五轮(表格)
    Bootstrap3.0学习第四轮(排版)
    Bootstrap3.0学习第三轮(栅格系统案例)
  • 原文地址:https://www.cnblogs.com/zhengchunhao/p/5652947.html
Copyright © 2011-2022 走看看