我有一台安装了JDK&JRE 6和7的Jenkins服务器。
所有项目都建立在1.6上,除了1.7依赖项目。
我已经将maven pom文件配置为使用JAVA_HOME_7环境PATH中的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安装期间,我收到以下错误:
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项目的兼容性?
非常感谢, 阿塔纳斯