1. 程式人生 > >當使用maven時候 -source 1.5 中不支援 diamond 運算子

當使用maven時候 -source 1.5 中不支援 diamond 運算子

當使用maven時候 出現這種問題 是因為沒有配置maven-compile的版本到合適的版本

-source 1.5 中不支援 diamond 運算子

 

 

解決方案

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-compiler-plugin</artifactId>

<version>3.1</version>

<configuration>

<source>1.8</source>

<target>1.8</target>

</configuration>

</plugin>