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

JDK9 with jigsaw file layer is not detected as valid JDK

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: core
    • Environment:
      - fedora 20. jdk8_25
      - build jigsaw jdk: build 1.9.0-ea-jigsaw-nightly-h1689-20141110-b38, mixed mode
    • Similar Issues:

      Description

      Hi,
      The new jigsaw jdk is not detected as valid jdk because tools.jar and dt.jar are removed from the lib path but are needed by jenkins for detection.

      file: hudson/model/JDK.java
      method: checkHomeDirectory

      Not sure how to make a nice validation for current and jigsaw jdk.

      As a workaround having void tools.jar and dt.jar allow jdk detection by jenkins.

        Attachments

          Issue Links

            Activity

            skygo Eric Barboni created issue -
            Hide
            alanb Alan Bateman added a comment -

            Just an FYI that the initial changes for JEP 220 (http://openjdk.java.net/jeps/220) have been pushed to JDK 9 and should appear in the jdk9-b41 build. So tools.jar, rt.jar and dt.jar are gone. Hopefully it's not too hard to update the home directory detection to work with the new modular runtime images.

            Show
            alanb Alan Bateman added a comment - Just an FYI that the initial changes for JEP 220 ( http://openjdk.java.net/jeps/220 ) have been pushed to JDK 9 and should appear in the jdk9-b41 build. So tools.jar, rt.jar and dt.jar are gone. Hopefully it's not too hard to update the home directory detection to work with the new modular runtime images.
            danielbeck Daniel Beck made changes -
            Field Original Value New Value
            Priority Minor [ 4 ] Major [ 3 ]
            Hide
            danielbeck Daniel Beck added a comment -

            Reducing priority again as this is only about input validation. Could extend the check mentioned in the description if there is something that would allow identifying a JDK directory. Do you know alternatives to checking presence of these jars that preferably works on all older JDKs as well?

            Show
            danielbeck Daniel Beck added a comment - Reducing priority again as this is only about input validation. Could extend the check mentioned in the description if there is something that would allow identifying a JDK directory. Do you know alternatives to checking presence of these jars that preferably works on all older JDKs as well?
            danielbeck Daniel Beck made changes -
            Priority Major [ 3 ] Minor [ 4 ]
            Hide
            alanb Alan Bateman added a comment - - edited

            The simplest thing is to check for is bin/javac (or bin\javac.exe). That should work for all releases.

            Show
            alanb Alan Bateman added a comment - - edited The simplest thing is to check for is bin/javac (or bin\javac.exe). That should work for all releases.
            Hide
            danielbeck Daniel Beck added a comment -

            It started out with the tools.jar check (commit lost to history), then added a Mac-specific test in https://github.com/jenkinsci/jenkins/commit/d1b27237707e97095657bd1ef2f0facaf84f32e0 that was modified for JENKINS-533 in https://github.com/jenkinsci/jenkins/commit/aef102cb727fe65305a5f66fc5949096c9a5b473.

            It's possible tools.jar was checked because it's easier than platform-dependent javac binary names.


            Given that section:

            All other files and directories in the lib directory must be treated as private implementation details of the run-time system. They are not intended for external use and their names, format, and content will be subject to change without notice.

            The only sensible solution seems to be to check for bin/javac and bin\javac.exe and if neither exists, provide the warning. Keep the existing two checks for compatibility in case there are other javac names on some platforms, they shouldn't hurt anything.

            Show
            danielbeck Daniel Beck added a comment - It started out with the tools.jar check (commit lost to history), then added a Mac-specific test in https://github.com/jenkinsci/jenkins/commit/d1b27237707e97095657bd1ef2f0facaf84f32e0 that was modified for JENKINS-533 in https://github.com/jenkinsci/jenkins/commit/aef102cb727fe65305a5f66fc5949096c9a5b473 . It's possible tools.jar was checked because it's easier than platform-dependent javac binary names. Given that section: All other files and directories in the lib directory must be treated as private implementation details of the run-time system. They are not intended for external use and their names, format, and content will be subject to change without notice. The only sensible solution seems to be to check for bin/javac and bin\javac.exe and if neither exists, provide the warning. Keep the existing two checks for compatibility in case there are other javac names on some platforms, they shouldn't hurt anything.
            danielbeck Daniel Beck made changes -
            Assignee Daniel Beck [ danielbeck ]
            danielbeck Daniel Beck made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            Hide
            danielbeck Daniel Beck added a comment -

            Proposed solution at https://github.com/jenkinsci/jenkins/pull/1499

            Would be really helpful if you could download the PR build at https://jenkins.ci.cloudbees.com/job/core/job/jenkins-core/1832/ (assuming it builds successfully) to see whether it works as expected.

            Show
            danielbeck Daniel Beck added a comment - Proposed solution at https://github.com/jenkinsci/jenkins/pull/1499 Would be really helpful if you could download the PR build at https://jenkins.ci.cloudbees.com/job/core/job/jenkins-core/1832/ (assuming it builds successfully) to see whether it works as expected.
            danielbeck Daniel Beck made changes -
            Remote Link This issue links to "PR 1499 (Web Link)" [ 11935 ]
            Hide
            danielbeck Daniel Beck added a comment -

            Please see comment above for build with proposed fix.

            Show
            danielbeck Daniel Beck added a comment - Please see comment above for build with proposed fix.
            Hide
            skygo Eric Barboni added a comment -

            Hi, sorry for the delay.
            I build from source (skipping test because of javassist && jdk 8 ) as I did not find a jenkins.war on the cloudbees jenkins instance.

            It's working: JDK 9 folder is detected as jdk, and older jdk 7 or jdk 8 are also detected as jdk

            Show
            skygo Eric Barboni added a comment - Hi, sorry for the delay. I build from source (skipping test because of javassist && jdk 8 ) as I did not find a jenkins.war on the cloudbees jenkins instance. It's working: JDK 9 folder is detected as jdk, and older jdk 7 or jdk 8 are also detected as jdk
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Daniel Beck
            Path:
            core/src/main/java/hudson/model/JDK.java
            http://jenkins-ci.org/commit/jenkins/1186e7b4047a70162a1a3be399fc449ae3b0e1f5
            Log:
            [FIXED JENKINS-25601] Amend JAVA_HOME check to work with JDK 9

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/java/hudson/model/JDK.java http://jenkins-ci.org/commit/jenkins/1186e7b4047a70162a1a3be399fc449ae3b0e1f5 Log: [FIXED JENKINS-25601] Amend JAVA_HOME check to work with JDK 9
            scm_issue_link SCM/JIRA link daemon made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            changelog.html
            core/src/main/java/hudson/model/JDK.java
            http://jenkins-ci.org/commit/jenkins/b33b921dc5d4dacdca7a9b73cfbe6f8a57f05307
            Log:
            JENKINS-25601 Noting merge of #1499.

            Compare: https://github.com/jenkinsci/jenkins/compare/75eeccf8668e...b33b921dc5d4

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/hudson/model/JDK.java http://jenkins-ci.org/commit/jenkins/b33b921dc5d4dacdca7a9b73cfbe6f8a57f05307 Log: JENKINS-25601 Noting merge of #1499. Compare: https://github.com/jenkinsci/jenkins/compare/75eeccf8668e...b33b921dc5d4
            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #3923
            [FIXED JENKINS-25601] Amend JAVA_HOME check to work with JDK 9 (Revision 1186e7b4047a70162a1a3be399fc449ae3b0e1f5)

            Result = SUCCESS
            daniel-beck : 1186e7b4047a70162a1a3be399fc449ae3b0e1f5
            Files :

            • core/src/main/java/hudson/model/JDK.java
            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #3923 [FIXED JENKINS-25601] Amend JAVA_HOME check to work with JDK 9 (Revision 1186e7b4047a70162a1a3be399fc449ae3b0e1f5) Result = SUCCESS daniel-beck : 1186e7b4047a70162a1a3be399fc449ae3b0e1f5 Files : core/src/main/java/hudson/model/JDK.java
            danielbeck Daniel Beck made changes -
            Labels lts-candidate
            olivergondza Oliver Gond┼ża made changes -
            Labels lts-candidate 1.596.2-fixed
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Daniel Beck
            Path:
            core/src/main/java/hudson/model/JDK.java
            http://jenkins-ci.org/commit/jenkins/bf6859f059bc809a8b1bae6ef184af56a37f79e0
            Log:
            [FIXED JENKINS-25601] Amend JAVA_HOME check to work with JDK 9

            (cherry picked from commit 1186e7b4047a70162a1a3be399fc449ae3b0e1f5)

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/java/hudson/model/JDK.java http://jenkins-ci.org/commit/jenkins/bf6859f059bc809a8b1bae6ef184af56a37f79e0 Log: [FIXED JENKINS-25601] Amend JAVA_HOME check to work with JDK 9 (cherry picked from commit 1186e7b4047a70162a1a3be399fc449ae3b0e1f5)
            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #4292
            [FIXED JENKINS-25601] Amend JAVA_HOME check to work with JDK 9 (Revision bf6859f059bc809a8b1bae6ef184af56a37f79e0)

            Result = UNSTABLE
            ogondza : bf6859f059bc809a8b1bae6ef184af56a37f79e0
            Files :

            • core/src/main/java/hudson/model/JDK.java
            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #4292 [FIXED JENKINS-25601] Amend JAVA_HOME check to work with JDK 9 (Revision bf6859f059bc809a8b1bae6ef184af56a37f79e0) Result = UNSTABLE ogondza : bf6859f059bc809a8b1bae6ef184af56a37f79e0 Files : core/src/main/java/hudson/model/JDK.java
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 159575 ] JNJira + In-Review [ 196131 ]
            oleg_nenashev Oleg Nenashev made changes -
            Epic Link JENKINS-40689 [ 177392 ]
            oleg_nenashev Oleg Nenashev made changes -
            Labels 1.596.2-fixed 1.596.2-fixed java11

              People

              • Assignee:
                danielbeck Daniel Beck
                Reporter:
                skygo Eric Barboni
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: