Saturday, December 13, 2014

Eclipse: The method ? of type ? must override a superclass method

Recent I import and git project into Spring Tool Suit and Eclipse, it comes up with the following annoying errors such as :

"The method prepare(Map, TopologyContext, OutputCollector) of type AnalyticBolt must override a superclass method"

My imported project is  littered with all these errors. After some search online, it turns out that these are caused by the compliance of eclipse to Java 1.5, which does not recognize @Overrride attribute.

I was able to correct this by:

1. Right-click the project and select "Properties"
2. "Java Compiler" in the "Properties" page and uncheck "Use compliance from execution environment 'J2SE-1.5' on the 'Java Build Path'
3. Set the 'Compiler compliance level:" to 1.7
4. Click "OK".

No comments:

Post a Comment