error: strings in switch are not supported in -source 1.6
switch(name){
(use -source 7 or higher to enable strings in switch)
It was really weird as I have set everything to 1.7 in Netbeans, OR SO I THOUGHT.
I tested the class using the command line and got confirmation that it can be compiled perfectly. Hence, by powers of deduction I realized that netbeans was the problem in all of this.
I finally found the solution from the project configuration. Even though the tools -> Java version is set to 1.7, under project configuration -> properties -> sources, the source/binary format TAB must be set to 1.7. Otherwise all hell ( this might be an exaggeration) breaks loose and the errors will pop up saying you cannot compile it.
No comments:
Post a Comment