(use the option "source 7 or higher to include rows in the switch"), Netbeans 7.1.2

I am using JDK 7 and Netbeans IDE 7.1.2. Going through Using a String in a Switch

tried to compile this example in my IDE, but I get this error.

switch (month.toLowerCase ()) {(use source 7 or higher to include rows in the switch) 1 error

You need your help. Thanks

+7
source share
3 answers

You need to set the source for your project,

right click> propertiesa> source> set here

+21
source

Generally on "-source 7": use JDK7

(For example, if you usually use JDK 6 and just want to use JDK 7 for a special project, etc.)

If you still have a problem using a different Netbeans JDK, the following steps may help.

First, install the JDK in any directory; it should not be your main JDK or entered in any PATHS or so.

All these steps should be considered.

In Netbeans, right click on the project -> Properties

  • → Libraries → Platform Management ... → Add Platform ... and Add JDK Directory
  • → Libraries → Java Platform: Select JDK 7
  • -> Sources -> Source / Binary Format: select JDK 7
+2
source

Intellij IDE handles itself, just click on the red light and select add JDK 7

0
source

All Articles