我正在使用Java 1.8.101版本。当我运行maven clean install时,那时我收到错误
strings in switch are not supported in -source 1.5
[ERROR] (use -source 7 or higher to enable strings in switch).
我不知道为什么,因为我已经在使用java 1.8.101版本了。\
任何帮助都会很棒。 非常感谢您提前寻求帮助。 附上截图。
答案 0 :(得分:4)
正如@Jeremy已经建议的那样,输入pom.xml
文件作为 -
<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>
并在命令行上使用mvn clean install
来验证更改。