0

i am getting strings in switch are not supported in -source 1.5 (use -source 7 or higher to enable strings in switch) in eclipse while run as->maven build. I am using java 8 and OS is ubuntu 16.04.

1 Answers1

1

you need to add maven-compiler-plugin with java version 1.8.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.3</version>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
    </configuration>
</plugin>

then go to project property > java compiler select jdk version 1.8. enter image description here

Anshul Sharma
  • 3,432
  • 1
  • 12
  • 17