I'm running Eclipse 2018-09 (4.9.0) on Windows 10. I'm using Open JDK 11 GA. I have a Maven project that was specified as using Java 8 source code.
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
That compiles fine using Maven 3.5.3 on the command line. That also compiles fine using Eclipse Eclipse 2018-09 (4.9.0).
I changed the compile Java versions to Java 11:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
That still builds fine on the command line using Maven 3.5.3. But in Eclipse 2018-09, I get errors all over the place:
'<>' operator is not allowed for source level below 1.7
Constructor references are allowed only at source level 1.8 or above
Default methods are allowed only at source level 1.8 or above
You get the idea.
I've already used Alt+F5
to update my Maven project (and subprojects) in Eclipse. I've done a complete clean and rebuild.
Because this compiles fine with Maven on the command line, this has to be an Eclipse problem, doesn't it? Sure, Eclipse doesn't support all new Java 11 features, yet, but this code has no Java 11 specific features. What's wrong?