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

查看:28
本文介绍了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:ayerutilsrcmainjavacom ataayerutilBrokerageCalendar.java:179: 错误:-source 1.3 不支持泛型

could not parse error message: (use -source 5 or higher to enable generics) D:ayerutilsrcmainjavacom ataayerutilBrokerageCalendar.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:ayerutilsrcmainjavacom	ataayerutilAPIHttpXmlClient.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天全站免登陆