I have a maven project configured to use Java 8 and all works fine, eclipse compiles code like:
Map map = new HashMap<>();
I observed this error when compiling with maven. To solve it, I had to fix my JAVA_HOME environment variable to the right JDK.