Q: Maven Issue: strings in switch are not supported in -source 1.5 [ERROR] (use -source 7 or higher to enable strings in switch) When I try to compile my maven i get this errors:
strings in switch are not supported in -source 1.5 [ERROR] (use -source 7 or higher to enable strings in switch)

It complains about the switch. see in the pic.
I've also attached my POM.XML.


A: Switch with string as argument is only supported by java  1.7 or higher. You compile with target version 1.5 which is the default for maven.
Add the following lines to your pom:
  <properties>
    <maven.compiler.source><Java_version></maven.compiler.source>
    <maven.compiler.target><Java_version></maven.compiler.target>
  </properties>

where <Java_version> is 1.7 or higher for example
  <properties>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
  </properties>

For more informations see https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html
