Syntax error, annotations are only available if source level is 5.0

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 经过以上设置后可顺利解决问题。

黑色头发:http://heisetoufa.iteye.com

你可能感兴趣的:(java,jdk,JUnit)