Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-75778

Can not build JDK 11 maven projecs on current JDK 21 Jenkins

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • maven-plugin
    • 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.

      See https://issues.jenkins.io/browse/JENKINS-28294

            Unassigned Unassigned
            bmaehr Bernhard M
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: