Cómo usar -source en IDEA
Frecuentes
Visto 258 equipos
1
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'?
1 Respuestas
2
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 java intellij-idea compatibility diamond-operator or haz tu propia pregunta.
What is your project language level set at? - Anthony Benavente