Reputation: 63062
Where is IJ picking up the language level ?? When compiling I am getting the following error:
Error:(29, 38) java: diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
Note: the pom.xml has NO mention of the java level.
But from screenshots we see FOUR places I have selected 1.8 !
Upvotes: 2
Views: 167
Reputation: 240900
place following in your pom.xml
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
IntelliJ respects's maven pom.xml's configuration, by default points to JAVA_HOME and which might not be set properly, So setting compiler version to 1.8 does the job here
Upvotes: 1