[Android] Troubleshooting: Syntax error, annotations are only available if source level is 1.5

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?

你可能感兴趣的:(Annotations)