Reputation: 1356
This seems like a simple question that I cannot find the answer to when googling.
The @Deprecated
tag is giving me a syntax error in eclipse.
Error:
Deprecated cannot be resolved to a type
Am I missing an import or something?
Edit: Using Eclipse Juno
Upvotes: 1
Views: 799
Reputation: 17595
Here is how to reproduce this error:
jdk5
or higher.Build Path > Configure Build Path...
Libraries
tab, remove the actual JRE System Library (1.5 or higher) and then add JRE System Library 1.4 or lower. Click OK.The project will rebuild and you'll get the error Deprecated cannot be resolved to a type
So you need to ckeck the setting under the Libraries
tab and make sure you have a run time 1.5
or higher.
Upvotes: 1
Reputation: 1356
I have solved the problem. Thank you to those who tried to help with comments.
The standard java library (JRE System Library) in the Java Build Path was incorrect.
I corrected this and the syntax error disappears.
Upvotes: 1
Reputation: 17707
YUou also need to make sure your compiler settings are configured to allow these 'new' features. Project->Properties and go to the Java Compiler section
Upvotes: 2