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

System default JDK wrongly used if JDK is created first

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Component/s: core
    • Labels:
      None
    • Similar Issues:

      Description

      I need to verify this, but I think what's happening is that when a Maven job (unverified on other job types), it sets the JDK to "(Default)", not null.

      So later if a JDK is configured in the system config page, the job will not use it, but continue to use the "(Default)" JDK.

        Attachments

          Issue Links

            Activity

            Hide
            ahorst Andreas Horst added a comment -

            Please note my comment on #10191.

            Show
            ahorst Andreas Horst added a comment - Please note my comment on #10191 .
            Hide
            danielbeck Daniel Beck added a comment -

            Cannot Reproduce on 1.58x:

            1. Create maven Job. No <jdk> in XML;
              println Jenkins.instance.getItemByFullName('JENKINS-12550').JDK

              in Script Console prints null

            2. Add the first JDK in the global config
            3. Repeat step 1. No <jdk>, script prints JDK name.
            4. Configure and Save the first Maven job. Still no <jdk>, script prints JDK name.
            5. Create a new maven job. Still no <jdk>, script prints JDK name.
            6. Add a second JDK in the global config. No <jdk>, script prints JDK name.
            7. Configure and Save a Maven job. Now there is <jdk> in XML (Default), script prints null again.
            8. Configure a Maven job to use a specified JDK, and Save. Now there is <jdk> in XML (JDK name), script prints JDK name.
            Show
            danielbeck Daniel Beck added a comment - Cannot Reproduce on 1.58x: Create maven Job. No <jdk> in XML; println Jenkins.instance.getItemByFullName( 'JENKINS-12550' ).JDK in Script Console prints null Add the first JDK in the global config Repeat step 1. No <jdk> , script prints JDK name. Configure and Save the first Maven job. Still no <jdk> , script prints JDK name. Create a new maven job. Still no <jdk> , script prints JDK name. Add a second JDK in the global config. No <jdk> , script prints JDK name. Configure and Save a Maven job. Now there is <jdk> in XML (Default), script prints null again. Configure a Maven job to use a specified JDK, and Save. Now there is <jdk> in XML (JDK name), script prints JDK name.
            Hide
            danielbeck Daniel Beck added a comment -

            Of course, given how weird the behavior is with one JDK installation, a job last configured when there was no or one JDK will change behavior depending on whether there are one or two JDKs configured globally. With one configured JDK, that will be used, with two configured, the system default will be used.

            Show
            danielbeck Daniel Beck added a comment - Of course, given how weird the behavior is with one JDK installation, a job last configured when there was no or one JDK will change behavior depending on whether there are one or two JDKs configured globally. With one configured JDK, that will be used, with two configured, the system default will be used.

              People

              • Assignee:
                Unassigned
                Reporter:
                kohsuke Kohsuke Kawaguchi
              • Votes:
                2 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: