原文:http://heisetoufa.iteye.com/blog/621396
syntax error,annotations are only available if source level is 5.0
解決辦法:project->properties->java compiler->compiler compliance level選擇5.0或者以上的jdk版本
project->java build path->libraries->add library...->junit->select "junit 4.0"->finish 經過以上設定後可順利解決問題。