我有一个Jenkins服务器,上面同时安装了JDK和JRE 6和7。
除了一个依赖于1.7的项目外,所有项目都是基于1.6构建的。
我已经配置了maven pom文件,使用JAVA_HOME_7环境路径中的Java编译器。
除了一个依赖于1.7的项目外,所有项目都是基于1.6构建的。
我已经配置了maven pom文件,使用JAVA_HOME_7环境路径中的Java编译器。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
**<executable>${env.JAVA_HOME_7}/bin/javac</executable>**
<fork>true</fork>
<verbose>false</verbose>
</configuration>
</plugin>
在执行mvn install时,我遇到了以下错误:
java.lang.RuntimeException: There was an error in the forked process
java.lang.UnsupportedClassVersionError: : Unsupported major.minor version 51.0
我认为这意味着服务器正在使用 JRE 1.6。
如何保留 JRE 1.6 并与 1.7 一起使用,以保持与旧的 1.6 项目和新的 1.7 项目的兼容性?
非常感谢, Atanas