Reputation: 65
Good evening! My question is odd but I could not run an existing maven project.
There is an error which IDE returns: and I have a bunch of them. I am using Intellij IDEA. Even if I run just simple mvn install I have the same issue. I googled but there is no positive result.
Error:(140, 74) java: diamond operator is not supported in -source 1.5 (use -source 7 or higher to enable diamond operator)
Upvotes: 1
Views: 40
Reputation: 637
As an addition to Michael W's answer. I think you also put these settings under Project?
And to be on the safe side, check here if the version is set correctly. Sometimes it differs with me. You can simply enter javac in the search settings.
Upvotes: 1
Reputation: 3555
IntelliJ requires you to add some properties to your pom.xml file
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
Also, check your selected SDK:
and the language level in your module settings:
Upvotes: 1