Java 1.7 still tells me that strings in switch statements are incompatible

I am using java 1.7 in intellij and it gives me a compilation error as if I am using pre-1.7. Saying: "Incompatible type. Found java.lang.String. Required 'byte, char, short or int'.

I jerk my brain, trying to understand why this is so. Thanks

+4
source share
3 answers

You need to change the language level in your IDE.

Check these settings:

  • File> Project Structure> Project> SDK Project
  • File> Project Structure> Project> Project Language Level
  • > a > > > >
  • > a > > > > SDK

. :

  • > > p > Java >

maven, -. pom.xml.

+13

, , java- java 1.6 . java 1.7

+1

, JDK JDK , IDE intellij. , JDK 1.7 , - JDK

0

All Articles