Despite specifying JDK 1.7 in all project settings (including in
File -> Project Structure -> Project :: Project SDK), the following error is produced by
IntelliJ 13 when trying to compile some simple Java 7 code which does use the diamond operator:
java: diamond operator is not supported in -source 1.5 (use -source 7 or higher to enable diamond operator)
Is there any other place in the configuration where the expected
-source 7 option should be enabled?
This question is tagged with
~ Asked on 2014-01-08 20:45:22
If nothing of this helps (my case), you can set it in your pom.xml, like this:
<properties> <maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.target>1.7</maven.compiler.target> </properties>
As this cool guy mentioned here: https://stackoverflow.com/a/25888116/1643465
~ Answered on 2014-11-13 23:04:17
Please check your project/module language levels (Project Structure | Project; Project Structure | Modules | module-name | Sources). You might also want to take a look at Settings | Compiler | Java Compiler | Per-module bytecode version.
Set also this:
File -> Project Structure -> Modules :: Sources (next to Paths and Dependencies) and that has a "Language level" option which also needs to be set correctly.
~ Answered on 2014-01-08 20:51:05