java: strings in switch are not supported in -source 1.5
(use -source 7 or higher to enable strings in switch)
Why this error, as we are trying to access feature of java(in our case switch statements) using java 1.5 which is actually supported in higher version of java (7 in our case).
IDE used is Intellij.
File > Project Structure >Project > Project language level
Change this to 1.7 or higher
File > Project Structure > Modules > Select the module > language level
File > settings > Java Compiler > change to latest compiler
Rerun the project, hope it will work fine 🙂