【发布时间】:2019-01-10 01:57:02
【问题描述】:
我已经阅读了许多类似的主题 - 但它们并没有解决我的问题,因为我有很好的导入:
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
问题如下:
The type Iterator is not generic; it cannot be parameterized with arguments <CustomClassName>
我正在使用JRE1.8
JAVA_HOME Variable 设置为 C:\Program Files\Java\jdk1.7.0_80
Eclipse Java EE IDE for Web Developers.
Version: Mars.2 Release (4.5.2)
Build id: 20160218-0600
怎么了??
maven compiler plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
【问题讨论】:
-
@Eran 这是生产代码,我不能分享它
-
检查项目设置 -> Java 编译器 -> 编译器合规级别
-
还要确保您的源代码中没有任何嵌套类、枚举或名为
Iterator的接口。 -
@RealSkeptic 添加屏幕
-
你使用一些构建工具(maven、gradle等)吗?