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

Debian/Ubuntu installer fails with OpenJDK 11.0.9.1

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • packaging
    • None
    • Ubuntu 20.04, openjdk 11.0.9.1, Jenkins 2.249.3
    • Jenkins core 2.263.1

      Jenkins fails to find a valid openjdk version on Ubuntu 20.04 when the version of openjdk includes more than three dots such as 11.0.9.1. 

      The sed regex used in the init script needs to be updated to more accurately match the version string.

       

      This is similar to bug JENKINS-57096

          [JENKINS-64212] Debian/Ubuntu installer fails with OpenJDK 11.0.9.1

          Tyler Maclean created issue -

          Tyler Maclean added a comment -

          I've made a pull request with a proposed fix at https://github.com/jenkinsci/packaging/pull/198

          Tyler Maclean added a comment - I've made a pull request with a proposed fix at https://github.com/jenkinsci/packaging/pull/198
          Mark Waite made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Mark Waite made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]

          Pavel Roskin added a comment -

          This is working for me:

          JAVA_VERSION=$($JAVA -version 2>&1 | sed -n ';s/.* version "\([^.]*\)\.\([^.]*\)\..*".*/\1\2/p;')
          

          I replaced "." (any symbol) with "[^.]" (not a period) in two places, it was apparently the intention to match numbers, not periods, and it only worked by accident for shorter version numbers.

          Pavel Roskin added a comment - This is working for me: JAVA_VERSION=$($JAVA -version 2>&1 | sed -n ';s/.* version "\([^.]*\)\.\([^.]*\)\..*" .*/\1\2/p;' ) I replaced "." (any symbol) with " [^.] " (not a period) in two places, it was apparently the intention to match numbers, not periods, and it only worked by accident for shorter version numbers.
          Mark Waite made changes -
          Link New: This issue is duplicated by JENKINS-64226 [ JENKINS-64226 ]
          Mark Waite made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Fixed but Unreleased [ 10203 ]
          Mark Waite made changes -
          Remote Link New: This issue links to "PR-198 update JDK version check in init script (Web Link)" [ 26342 ]

          Mark Waite added a comment -

          Included in weekly release Jenkins 2.268. Will be included in LTS release Jenkins 2.263.1.

          Mark Waite added a comment - Included in weekly release Jenkins 2.268. Will be included in LTS release Jenkins 2.263.1.
          Dirk Heinrichs made changes -
          Comment [ [~markewaite], just installed 2.263.1 on a test host. Looks like the fix is not included. ]

            Unassigned Unassigned
            tam116 Tyler Maclean
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: