Maven:错误:-source 1.3中不支持泛型,我正在使用1.6 [英] Maven : error: generics are not supported in -source 1.3 , I am using 1.6

查看:50
本文介绍了Maven:错误:-source 1.3中不支持泛型,我正在使用1.6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将现有的Maven项目导入到Eclipse IDE中. 我已经修改了其中的一些代码,编译成功, 我正在使用Java 1.6作为编译器 而当我尝试运行maven clean install -X

I have imported an existing Maven project into Eclipse IDE . I have modified some code in it , it compiled successfully , I am using Java 1.6 as compiler and when i am trying to run maven clean install -X

出现以下错误

无法解析错误消息:(使用-source 5或更高版本来启用泛型) D:\ bayer \ util \ src \ main \ java \ com \ tata \ bayer \ util \ BrokerageCalendar.java:179:错误:-source 1.3不支持泛型

could not parse error message: (use -source 5 or higher to enable generics) D:\bayer\util\src\main\java\com\tata\bayer\util\BrokerageCalendar.java:179: error: generics are not supported in -source 1.3

   private static Hashtable<String, Boolean> nyseHolidays = new Hashtable<String, Boolean>();
                           ^

could not parse error message:   (use -source 5 or higher to enable generics)
D:\bayer\util\src\main\java\com\tata\bayer\util\APIHttpXmlClient.java:27: error: generics are not supported in -source 1.3
                        Class<? extends APIResponse> responseClass) {
                         ^

请提出任何解决方法的建议??

Please suggest any ideas as how to resolve this ??

推荐答案

您是否声明要在项目pom.xml中使用Java 1.6?

Did you declare that you want to use java 1.6 in your project pom.xml?:

<build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.3.2</version>
                    <configuration>
                        <source>1.6</source>
                        <target>1.6</target>
                        <compilerArgument></compilerArgument>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

这篇关于Maven:错误:-source 1.3中不支持泛型,我正在使用1.6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆