I tied to build the code using java 11 version in cloud manager pipeline but the build is failed with below error.
14:58:50,859 [main] [WARNING] Rule 1: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with message: Maven must be executed with a Java 11 JRE or higher.
I have below plugin to check the java version, Seems like the system is my pom files is looking for java 11 but it failed to find it.
How do we check what java version is installed in cloud manager ? Is not java 11 supported in cloud manager?
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>[3.3.9,)</version>
</requireMavenVersion>
<requireJavaVersion>
<message>Maven must be executed with a Java 11 JRE or higher.</message>
<version>11</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @Mario248 on cloud manager, the Java versions installed are Oracle JDK 8u202 and Oracle JDK 11.0.2. By default, the JAVA_HOME environment variable is set to /usr/lib/jvm/jdk1.8.0_202 which contains Oracle JDK 8u202 and maven 3.6.0 is installed.
as you mentioned in the plugin, you can use a specific JDK version.
try building it using the maven toolchain plugin.
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-toolchains-plugin</artifactId> <version>1.1</version> <executions> <execution> <goals> <goal>toolchain</goal> </goals> </execution> </executions> <configuration> <toolchains> <jdk> <version>11</version> <vendor>oracle</vendor> </jdk> </toolchains> </configuration> </plugin>
Find out more here
Hi @Mario248 on cloud manager, the Java versions installed are Oracle JDK 8u202 and Oracle JDK 11.0.2. By default, the JAVA_HOME environment variable is set to /usr/lib/jvm/jdk1.8.0_202 which contains Oracle JDK 8u202 and maven 3.6.0 is installed.
as you mentioned in the plugin, you can use a specific JDK version.
try building it using the maven toolchain plugin.
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-toolchains-plugin</artifactId> <version>1.1</version> <executions> <execution> <goals> <goal>toolchain</goal> </goals> </execution> </executions> <configuration> <toolchains> <jdk> <version>11</version> <vendor>oracle</vendor> </jdk> </toolchains> </configuration> </plugin>
Find out more here