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

Wrong value is assigned to JAVA_HOME by JDK Installer

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • slave-setup-plugin
    • Master on Linux, slave on Solaris.

      This is version 1.464.

      I'm configuring automatic JDK installation from our local server. I used "Run Command" option for the installer, to simply copy the binaries, as in:

      echo "===============" && cd $HOME/hudson/tools && pwd && echo "Installing JDK in `pwd`" && if [ -d "jdk_1.6.0_32/bin" ]; then echo "JDK already installed, skipping installation"; else cp -R <server-location>/binaries/solaris-sparc/* jdk_1.6.0_32; fi; echo "==============="

      I also specified the following for the Tool Home:

      $HOME/hudson/tools/jdk_1.6.0_32

      The output of the above is that JDK is copied over fine, but JAVA_HOME is set incorrectly to:

      JAVA_HOME is /export/home/j2eetest/hudson/tools/jdk_1.6.0_32//export/home/j2eetest/hudson/tools/jdk_1.6.0_32

      For some reason the path is repeated. I cannot remove my setting from Tool Home, as it is a required field, so not sure how to workaround it, other than hardcode JAVA_HOME in the build script later.

      Another issue is that the above installer is called 3 times in the build. First it, at the beginning of the run, as expected, but then 2 more times after the run fails (since JAVA_HOME is set incorrectly):

      ---------------------
      Error: JAVA_HOME is not defined correctly. We cannot execute /export/home/j2eetest/hudson/tools/jdk_1.6.0_32//export/home/j2eetest/hudson/tools/jdk_1.6.0_32/bin/java
      Build step 'Execute shell' marked build as failure
      Archiving artifacts
      [jdk_1.6.0_32] $ sh -e /export/home/j2eetest/hudson/tools/jdk_1.6.0_32/hudson1565215954249512158.sh
      ===============
      /export/home/j2eetest/hudson/tools
      Installing JDK in /export/home/j2eetest/hudson/tools
      JDK already installed, skipping installation
      ===============
      Collecting JWSDP SQE reports
      [jdk_1.6.0_32] $ sh -e /export/home/j2eetest/hudson/tools/jdk_1.6.0_32/hudson9099275328093437047.sh
      ===============
      /export/home/j2eetest/hudson/tools
      Installing JDK in /export/home/j2eetest/hudson/tools
      JDK already installed, skipping installation
      ===============
      Finished: FAILURE
      ---------------------

          [JENKINS-13832] Wrong value is assigned to JAVA_HOME by JDK Installer

          evernat added a comment -

          @lidiam
          Is it reproduced with a recent Jenkins version?

          evernat added a comment - @lidiam Is it reproduced with a recent Jenkins version?

          Oleg Nenashev added a comment -

          Not an INFRA issue

          Oleg Nenashev added a comment - Not an INFRA issue

            kohsuke Kohsuke Kawaguchi
            lidiam lidiam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: