1

Maven is telling me the following, even though I have everything set to Java 8.

File -> Project Structure -> Modules

[Edit Configuration -> Maven -> Build -> Run][2]

[Default Project Structure][3]

All are set to Language Level 8

[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.730 s
[INFO] Finished at: 2017-02-06T20:29:55+01:00
[INFO] Final Memory: 7M/19M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project kingdoms: Compilation failure
[ERROR] /C:/Users/Marius/Desktop/IntelliJ projects/Kingdoms/src/main/java/me/expdev/kingdoms/files/JsonConfig.java:[24,54] diamond operator is not supported in -source 1.6
[ERROR] (use -source 7 or higher to enable diamond operator)
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Process finished with exit code 1

Any help would be greatly appreciated. I tried googling around, but didn't find anyone having this error, therefor resorting to Stack Overflow.

Note: I'm using IntelliJ Ultimate Edition, licensed, if that is relevant.

ExpDev
  • 65
  • 1
  • 10

1 Answers1

1

Check your pom.xml and make sure you are setting the compiler source to 1.7 or higher. See: https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html

Michael Peacock
  • 2,011
  • 1
  • 11
  • 14