简体   繁体   中英

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)

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:

在此处输入图片说明

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. 设置

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM