-
Bug
-
Resolution: Won't Fix
-
Major
-
None
-
Jenkins 2.504.2 on JDK 21.0.7+6-LTS
Maven Plugin 3.26
JDK to Build Project OpenJDK 11.0.13
Building Maven Project with JDK 11 version fails with the error
Exception in thread "main" java.lang.NoSuchMethodError: getMainType
This happens because LD_LIBRARY_PATH is set to
/opt/java/openjdk/lib/server:/opt/java/openjdk/lib
instead of
${JAVA_HOME}/lib/server:${JAVA_HOME}/lib
Setting LD_LIBRARY_PATH manually by for Inject Environment Variables Plugin solves the issue for Freestyle Jobs, but not for Maven Jobs because maven is forking during the build process and the maven plugin is using the correct LD_LIBRARY_PATH for the first maven invocation but not the forked ones.