Cómo usar -source en IDEA

How can I fix this? When I trying to compile some code, I get this message:

java: diamond operator is not supported in -source 1.6
  (use -source 7 or higher to enable diamond operator)

On my PC I have this settings and I using IDEA:

C:\Windows\System32>javac -version
javac 1.7.0_25

C:\Windows\System32>java -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

What exactly should I do to compile it? Where should I place '-source 7'?

preguntado el 28 de mayo de 14 a las 13:05

What is your project language level set at? -

1 Respuestas

Go to your project structure menu (ctrl+alt+shift+s) and change your "Project Language Level" to "7.0 Diamonds, ARM, multi-catch, etc.". It's under the Project tab in your sidebar to the left.

contestado el 28 de mayo de 14 a las 14:05

Done.It's compiled now :) Thanks. - Maksim Nesterenko

See the request about making it more discoverable: youtrack.jetbrains.com/issue/IDEA-121971 - Pedro Gromov

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.