“Syntax error, annotations are only available if source level is 1.5 or greater”

The default lower version of the JDK was used in the project creation process; just set the JDK version above 1.5.
right-click on the project and select properties at the bottom to go to the project configuration page

Read More: