日期:2014-05-20  浏览次数:20780 次

集合
Can anyone explain the following error in Eclipse 3.2? I am running Java SDK
1.6 and Eclipse's compliance settings are set to "6.0"

Offending code:
List<Client> clients = new ArrayList<Client>();

Error message:
The type List is not generic; it cannot be parameterized with arguments
<ChatServer.Client>
 thanks
------解决方案--------------------
eclipse中jdk设置为1.6的。
Preferences -> java -> Compiler 看看是否是1.6版本的?
------解决方案--------------------
对jdk好似1.5版本以下不支持泛型,
也就是List<T>的方式。。。
------解决方案--------------------
我的eclipse用的是3.5.2的版本,配置项可能已经发生比较大的变动。

看看这个是不?
在eclipse菜单点window-->Preferences-->展开java,
下面有个Installed JREs,点击它看右边,选中右边的jdk,按键盘del键删除掉.再点Add按钮,在jre name输入jdk1.6点击Browse按钮找到你jdk的安装路径,最后点击 "OK"就设置完毕了
------解决方案--------------------
在eclipse菜单点window-->Preferences-->展开java,
下面有个Installed JREs,点击它看右边,选中右边的jdk,按键盘del键删除掉.再点Add按钮,在jre name输入jdk1.6点击Browse按钮找到你jdk的安装路径,最后点击 "OK"就设置完毕了