mvn compile时报错:javac:invalid target release: 1.7

mvn compile时报错:javac:invalid target release: 1.7

Add the following to your pom under build and plugins it should target 1.6

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
上面的pom配置文件指定maven compiler的jdk版本。如指定1.6时,JAVA_HOME设置为jdk1.6/jdk1.7都可以,但如果指定的是1.7时,JAVA_HOME要设置为jdk1.7,否则会报上述错。

junit报错:Failed to load ApplicationContext
测试类的方法需与被测试的类的包名一致。

猜你喜欢

转载自xafc2370.iteye.com/blog/1684542
mvn