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

Inconsistent setting of environment variables in jdk tool plugin

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • jdk-tool-plugin
    • None

      If a freestyle job has 'system' jdk set, behaviour changes depending on how many installers are present.

      To reproduce:

      • Ensure only one jdk installer is configured
      • Create freestyle job with selected jdk as 'system'
      • Ensure job runs on worker node (not controller)
      • Add 'execute windows batch command' step to job, which runs 'java -version'
      • Run job
      • Add second configured jdk installer to global tools configuration
      • Re-run job

      Observed results:

      • First run of job succeeds and displays jdk information
      • Second run fails, which java executable not found in path

       

          [JENKINS-70761] Inconsistent setting of environment variables in jdk tool plugin

          Tony Noble added a comment -

          Minor update:

          When only one installer is configured, the jdk selector doesn't appear in freestyle job configuration page.  But it appears that the job uses the configured installer and sets the relevant environment variables, regardless of what build steps are defined

          When more than one installer is configured, the jdk selector is available and defaults to 'system'.  However, it also affects existing jobs as they no longer use the first configured installer.  When the configuration page is brought up for them, they now also show 'system' as the configured jdk for the job and no JAVA_HOME or PATH information is set for the job.

          Tony Noble added a comment - Minor update: When only one installer is configured, the jdk selector doesn't appear in freestyle job configuration page.  But it appears that the job uses the configured installer and sets the relevant environment variables, regardless of what build steps are defined When more than one installer is configured, the jdk selector is available and defaults to 'system'.  However, it also affects existing jobs as they no longer use the first configured installer.  When the configuration page is brought up for them, they now also show 'system' as the configured jdk for the job and no JAVA_HOME or PATH information is set for the job.

            Unassigned Unassigned
            stealthdj Tony Noble
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: