Problem :
Error Message : Syntax error, annotations are only available if source level is 1.5
Solution :
You can do that at Window > Preferences > Java > Compiler for the entire workspace or on a project by project bases by right clicking in the Package Explorer view and selecting Properties > Java Compiler .
备注 :如果现在Eclipse中设置的JRE是1.6,出现了如上的错误。先从preferences里把JRE改成1.5,rebuild, 然后再改回1.6就没有错误了。why?
本文介绍了解决Eclipse中出现的注解语法错误的方法。通过调整项目的JRE设置来解决由于源代码级别不匹配导致的问题。首先将JRE版本设置为1.5进行重建,之后再改回1.6即可消除错误。
1189

被折叠的 条评论
为什么被折叠?



