eclipse编译Syntax error, parameterized types are only available if source level is 5.0
2015-09-17 14:33
387 查看
在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以上 即可。
在使用泛型的地方提示:
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以上 即可。
相关文章推荐
- Java 脚本支持
- eclipse安卓开发环境搭建全过程
- struts2中<s:property>的用法
- Spring AOP Advices - After throwing advice example - xml based configuration
- 韩顺平 java 第二讲 变量 数据类型
- test3.11
- java日志: logback和slf4j
- spark取得lzo压缩文件报错 java.lang.ClassNotFoundException
- Spring AOP Advices - After returning advice example - xml based configuration
- 使用CXF框架学习搭建WebService(三)
- 通过Java Api与HBase交互(转)
- Spring Resource bundle with ResourceBundleMessageSource example
- JavaBean的get、set方法引发的讨论
- HBase Java API类介绍
- Java中的StringUtils类
- test3.10
- Java在Jar包中初始化log4j的方法
- MyEclipse快捷键大全(Java程序员专供)
- Java Eclipse log4j配置
- eclipse里的一些知识