zoukankan      html  css  js  c++  java
  • eclipse里不支持泛型的解决方法

    提示错误如下:Syntax error, parameterized types are only available if source level

    在myeclipse里引入新项目的时候会报如下错误:

    在使用泛型的地方提示:

    Multiple markers at this line
    - Syntax error, parameterized types are only available if source level
    is 5.0
    - The type List is not generic; it cannot be parameterized with
    arguments <Application>

    1)一种是Eclipse对所有项目默认的设置是5.0以下,项目继承了默认设置(在Preferences/Java/Compiler里改为5.0或高于5.0)
    另一种是项目里设置了source level 5.0以下(在 项目属性/Java Compiler 里改为5.0或高于5.0)

    你的JDK 版本比较旧,或者你装了比较新的版本,但是你在Eclipse中的设置有问题,编译级别设置的不是比较新的版本的编译器。
    eclipse措无题诗如下:
    Multiple markers at this line
    - Syntax error, parameterized types are only available if source level
    is 5.0
    译:语法错误 ,泛型只有在5.0以上的版本才支持
    - The type List is not generic; it cannot be parameterized with
    arguments <Application>
    List 不是泛型,引起的原因还是编译器不支持~~

    解决办法: 在Eclipse中,菜单条 ---"Windows" ----"preferneces"
    在弹出对话框中 ,在左侧列表框中 选择 "JAVA" ---子菜单中 "compiler" ...
    然后在右侧把 "Compiler compliance level" 设置成5.0以上 即可。

    Top
    收藏
    关注
    评论
  • 相关阅读:
    vs调试技巧
    ubuntu中安装Docker
    Docker的简单认知
    mysql笔记01
    5款实用的硬盘、SSD固态硬盘、U盘、储存卡磁盘性能测试工具绿色版
    怎么用HD Tune检测硬盘坏道
    Dreamweaver_CS6安装与破解
    Microsoft Office 2013 (64位) 免费完整版(安装 + 激活)
    Microsoft office2007免费版下载(安装 + 破解)
    OneNote如何使用
  • 原文地址:https://www.cnblogs.com/shiqi/p/2479621.html
Copyright © 2011-2022 走看看