从别人那儿拷贝过来的myeclipse java工程,打开一看标红了一大片,仔细一看,原来是不识别enum关键字,这就有点尴尬了。

  我自己重新建了一个java工程,测试了下,假如我在新建工程的时候选择JavaSE-1.6:

  是识别enum关键字的,但是假如我选择第二个或者默认的jdk1.8,那就不行了,后来发现java compiler compliance level中的最高上限也才1.7,所以,两种解决方法(原理是一样的),一是将compiler compliance level设置到1.5以上,另一个就是把.settings下的org.eclipse.jdt.core修改为以下内容:

  

eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

应该就能解决问题了。

最新文章

  1. 根据浏览器显示界面大小变换,替换css文件方法
  2. SQLServer一次性删除重复的数据
  3. 词频统计web
  4. Linux rpm 查询
  5. Security configuration of SSH login entry - enterprise security practice
  6. 使用Android应用调用Web Service
  7. 18种CSS3loading效果完整版,兼容各大主流浏览器,提供在线小工具使用
  8. 5个让你的SaaS应用大卖的技巧
  9. jquery选择器中两个class是什么意思?
  10. 每天一个linux命令(1):which命令(转)
  11. MATLAB图像处理基础
  12. IOS 类似于网易新闻首页新闻轮播的组件
  13. 扩展jquery插件的方法
  14. dubbo结构及通信简介
  15. .NET性能优化小技巧
  16. LeetCode 160 相交链表
  17. windows短路径转换成长路径
  18. 王者荣耀交流协会第5次Scrum立会
  19. 最新Android & iOS设计尺寸规范
  20. Sift中尺度空间、高斯金字塔、差分金字塔(DOG金字塔)、图像金字塔

热门文章

  1. ubuntu无法update
  2. 1267 老鼠的旅行 2012年CCC加拿大高中生信息学奥赛
  3. Android Studio Module 的添加与删除
  4. 使用CDN
  5. LeetCode 970. Powerful Integers (强整数)
  6. mac 浏览器解决跨域问题
  7. ROADS - Roads
  8. Uva 11151 - Longest Palindrome
  9. hdoj--5611--Baby Ming and phone number(模拟水题)
  10. min-max容斥小结