【发布时间】:2018-09-22 14:39:35
【问题描述】:
我有一个maven项目,当我尝试通过pom.xml文件执行时,得到如下编译错误
C:testscripts/TC_Maintenance.java:[137,48] “-source 1.6 不支持 switch 中的字符串 (使用 -source 7 或更高版本在 switch 中启用字符串)"
我已经在 maven 中配置了 jdk 1.8,请您解决这个问题。 我们也有在 pom.xml 文件中调用的父 pom
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
【问题讨论】:
-
请将您的 pom.xml 的相关部分添加到您的问题中。
-
还要检查
java -version,看看你真的在使用jdk 1.8 -
您是尝试使用 eclipse maven 插件还是通过命令行触发 maven 构建?
标签: java maven selenium-webdriver pom.xml