Compiler compliance configuration in Eclipse
I am running into this popular error "method does not override or implement a method from a supertype" in my code. I have spent nearly 5 hours reading on various solutions offered in the past and none of them are helping me. What is it that I am missing?
Here are the things that I have tried:
- Made sure that the compiler compilation is set to 1.8
- JRE is 1.8
- Exited and re-imported my eclipse project in java to see if that helps
- mvn clean install -U
- Used to below properties in my pom.xml file
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</properties>
- Used another way of mentioning java versions for target and source as below
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
<version>3.8.1</version>
</plugin>
</plugins>
What am I doing?
I am using Easy Rules. I implemented RuleListener as below: I keep getting the "method does not override or implement a method from a supertype".
public class PositionalStrengthListener implements RuleListener {
private static Logger logger = LoggerFactory.getLogger(PositionalStrengthListener.class);
@Override
public void onSuccess(Rule rule, Facts facts) {
logger.debug("OnSuccess: PositionalStrengthListener");
}
public void onFailure(Rule rule, Facts facts, Exception exception) {
logger.debug("On failure:PositionalStrengthListener");
}
}
I am implementing this interface: https://github.com/j-easy/easy-rules/blob/master/easy-rules-core/src/main/java/org/jeasy/rules/api/RuleListener.java
I was focusing on OnSuccess @Override error message and hence didn't add @Override on OnFailure but I get the same error with OnFailure if I add @Override.
Below is the easy rules dependency in pom.xml file.
<!-- https://mvnrepository.com/artifact/org.jeasy/easy-rules -->
<dependency>
<groupId>org.jeasy</groupId>
<artifactId>easy-rules-core</artifactId>
<version>4.1.0</version>
</dependency>
<dependency>
<groupId>org.jeasy</groupId>
<artifactId>easy-rules-support</artifactId>
<version>3.3.0</version>
</dependency>