With the following simple class I get java: Duplicate methods named spliterator with the parameters () and () are inherited from the types java.util.List<T> and java.lang.Iterable<T>
error if using Eclipse compiler in IDEA with JDK 8:
public class Java8Test {
public static interface Traverable<T> extends Iterable<T> {}
public static interface List<T> extends Traverable<T>, java.util.List<T> {}
}
If change the compiler to javac, then there is no error. The error also gone if switched to JDK 6 with eclipse compiler.
IDEA version: 12.1.5
I got the same error when trying to compile Java 7 code with a Java 8 JDK.
The solution that worked for me was changing the JRE configured in Eclipse to a Java 7 one: Window -> Preferences -> Java -> Installed JREs
. Edit the existing one and select a directory containing a Java 7 JDK.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With