I am using JDK 7 and Netbeans IDE 7.1.2. Going through Using string in switch
Was trying to compile that sample example in my IDE but I am getting this error.
switch (month.toLowerCase()) { (use -source 7 or higher to enable strings in switch) 1 error
Need your help.
Thanks
You need to set the source for your project,
right click > properties > source > set here
(For example if you are normally using JDK 6 and just want to use JDK 7 for a special project etc.)
If you still have problem to use a different JDK in Netbeans, the following steps may help.
First, install JDK to any directory, it does not have to be your main JDK or entered to any PATHS or so.
In Netbeans, right-click on the project -> Properties
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With