Error:-
java: strings in switch are not supported in -source 1.5
(use -source 7 or higher to enable strings in switch)
java: strings in switch are not supported in -source 1.5
(use -source 7 or higher to enable strings in switch)
Solution:-
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.
Step1:-
File > Project Structure >Project > Project language level
Change this to 1.7 or higher
Step2:-
File > Project Structure > Modules > Select the module > language level
Step3:-
File > settings > Java Compiler > change to latest compiler
Rerun the project, hope it will work fine 🙂
Learn Selenium