intellij idea Java:diamond演算子は-source 1.5ではサポートされていません

赤い部分を追加するだけで、私のjdkはバージョン1.8であり、実際の状況に応じて変更します。
<?xml version = "1.0" encoding = "UTF-8" ?>
< project xmlns = "http://maven.apache.org/POM/4.0.0" xmlns:xsi = "http://www.w3 .org / 2001 / XMLSchema-instance " xsi :schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd " > < modelVersion > 4.0.0 </ modelVersion > < のgroupId > org.example </ のgroupId > < たartifactId > maven_java <






バージョン> 1.0-SNAPSHOT </ バージョン>
<build>
<plugins>
<plugin>
<groupId> org.apache.maven.plugins </ groupId>
<artifactId> maven-compiler-plugin </ artifactId>
<version> 3.8.1 </ version>
<configuration>
<source> 1.8 </ source>
<target> 1.8 </ target>
</ configuration>
</ plugin>
</ plugins>
</ build>


</ プロジェクト>

おすすめ

転載: www.cnblogs.com/longchang/p/12674933.html