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

SSHLauncher does not respect Java related Node properties in DefaultJavaProvider

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • ssh-slaves-plugin
    • None
    • *nix slave

      SSHLauncher uses an array of potential Java locations defined in the DefaultJavaProvider method. If the Java executable is not present in one of the listed locations, the SSH Slave fails to connect. (The linux slave I am attempting to connect to, for instance, has a JAVA_HOME of /opt/java1.5)

      DefaultJavaProvider should check slave configuration Node Properties that apply to java:

      • Environment Variables > JAVA_HOME
      • Environment Variables > PATH
      • Tool Locations > JDK

          [JENKINS-5412] SSHLauncher does not respect Java related Node properties in DefaultJavaProvider

          chris_r_harmoney created issue -

          danbeaulieu added a comment -

          Hello, attached is a patch that will use JAVA_HOME node environment variable and/or a JDK tool location configured for the node.

          danbeaulieu added a comment - Hello, attached is a patch that will use JAVA_HOME node environment variable and/or a JDK tool location configured for the node.
          danbeaulieu made changes -
          Attachment New: SSHLauncher_javabytoollocation.patch [ 19374 ]
          Alan Harder made changes -
          Assignee Original: Stephen Connolly [ stephenconnolly ] New: Alan Harder [ mindless ]

          Alan Harder added a comment -

          Thanks Dan!

          Alan Harder added a comment - Thanks Dan!

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/plugins/ssh-slaves/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java
          http://jenkins-ci.org/commit/30464
          Log:
          [ssh-slaves] [FIXED JENKINS-5412] based on patch from danbeaulieu,
          add code in DefaultJavaProvider to check node properties for
          JAVA_HOME env var or JDK tool location in searching for java.
          Also updated one deprecated API.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/plugins/ssh-slaves/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java http://jenkins-ci.org/commit/30464 Log: [ssh-slaves] [FIXED JENKINS-5412] based on patch from danbeaulieu, add code in DefaultJavaProvider to check node properties for JAVA_HOME env var or JDK tool location in searching for java. Also updated one deprecated API.
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Andrew Bayer made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 135501 ] New: JNJira + In-Review [ 203521 ]

            mindless Alan Harder
            chris_r_harmoney chris_r_harmoney
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: