Kirill Barsukov
Kirill Barsukov

Reputation: 65

How to eliminate a specific error while is running maven project

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

Answers (2)

Sven M.
Sven M.

Reputation: 637

As an addition to Michael W's answer. I think you also put these settings under Project?

Project Settings

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. Settings

Upvotes: 1

Michael W
Michael W

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:

enter image description here

and the language level in your module settings:

enter image description here

Upvotes: 1

Related Questions