4

i am using Java 1.8.101 version. when i run maven clean install, at that time i am getting error

strings in switch are not supported in -source 1.5
[ERROR] (use -source 7 or higher to enable strings in switch).

I don't know why because already i am using java 1.8.101 version.\

Any help would be great. Thanks a lot in advance for help. Attached screenshot.

java

Raman Sahasi
  • 30,180
  • 9
  • 58
  • 71
Rajender Pal
  • 41
  • 1
  • 8

1 Answers1

4

As already suggested by @Jeremy as well, make an entry to the pom.xml file as -

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

and use mvn clean install on the command line to verify the change.

Naman
  • 27,789
  • 26
  • 218
  • 353