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

launcing slave detects non existing JDK

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      With SSH slave plugin, I have the following issue:

      On the target machine, we still have JDK 1.7 as default java (the software running is rather old). As Jenkins needs 1.8, it is installed in addition to this. I then tried to start the slave, with the following output:

      (some ugly shell script code here...)
      [06/11/18 16:11:02] [SSH] Starting sftp client.
      [06/11/18 16:11:02] [SSH] Copying latest slave.jar...
      [06/11/18 16:11:04] [SSH] Copied 767,078 bytes. Expanded the channel window size to 4MB
      [06/11/18 16:11:04] [SSH] Starting slave process: cd "/home/baker/jenkins" && /opt/jdk1.8.0_162/bin/java -Xmx1572m -jar slave.jar
      bash: /opt/jdk1.8.0_162/bin/java: No such file or directory Slave JVM has terminated.
      Exit code=127

      That is wondering me, because directory /opt/jdk1.8.0_162 doen't even exist. I also tried to set the JAVA_HOME in the config of the node and also tried to add the JDK7 tool location, but that does not change anything. It would be great if I could configure it here.

        Attachments

          Issue Links

            Activity

            Hide
            ifernandezcalvo Ivan Fernandez Calvo added a comment -

            which Jenkins core version do you use?

            https://jenkins.io/changelog-stable/#v2.60.3

            ```
            3.11
            Release date: Aug 18, 2017 => Jenkins 2.76

            ❗️ Warning! Starting from this release, Jenkins Remoting requires Java 8 to run. In edge cases it may require manual actions during the upgrade. See compatibility notes in this blogpost. Old JNLP-connect and JNLP2-connect agent protocols are now officially deprecated. There are also changes in the JAR signing.
            ```

            Show
            ifernandezcalvo Ivan Fernandez Calvo added a comment - which Jenkins core version do you use? https://jenkins.io/changelog-stable/#v2.60.3 ``` 3.11 Release date: Aug 18, 2017 => Jenkins 2.76 ❗️ Warning! Starting from this release, Jenkins Remoting requires Java 8 to run. In edge cases it may require manual actions during the upgrade. See compatibility notes in this blogpost. Old JNLP-connect and JNLP2-connect agent protocols are now officially deprecated. There are also changes in the JAR signing. ```
            Hide
            dheld Daniel Held added a comment -

            It's Version 2.112.

            So, it's quite obvious that we don't need Java 1.8 (that's what colleagues said to me). But I'm wondering more and more why jenkins thinks Java is installed in /opt/jdk1.8.0_162/bin/java...

            Show
            dheld Daniel Held added a comment - It's Version 2.112. So, it's quite obvious that we don't need Java 1.8 (that's what colleagues said to me). But I'm wondering more and more why jenkins thinks Java is installed in /opt/jdk1.8.0_162/bin/java...
            Hide
            dheld Daniel Held added a comment -

            OK, re-checked again. The problem is that there are 2 locations to set the java runtime:

            • The 'JDK 1.7' option under tool locations (which I found, but this option is not used)
            • JavaPath under Launch Method (which I did not find, because I found option 1)

            So, the root cause here seems to be the misleading GUI, combined with my inability to find documentation on how to set up this.

            In addition to this, there are 2 additional issues:

            • if the autodetection is run, java -version reports Version 1.7, but it isn't installed in any of the paths
            • if I try 1.7 via manual setting, I get an IllegalClassVersionError
            Show
            dheld Daniel Held added a comment - OK, re-checked again. The problem is that there are 2 locations to set the java runtime: The 'JDK 1.7' option under tool locations (which I found, but this option is not used) JavaPath under Launch Method (which I did not find, because I found option 1) So, the root cause here seems to be the misleading GUI, combined with my inability to find documentation on how to set up this. In addition to this, there are 2 additional issues: if the autodetection is run, java -version reports Version 1.7, but it isn't installed in any of the paths if I try 1.7 via manual setting, I get an IllegalClassVersionError
            Hide
            ifernandezcalvo Ivan Fernandez Calvo added a comment -

            on Jenkins Core 2.112 you can not use Java 7 to run the slave.jar process, since 2.76 you need Java 8 for remoting, because of that it is trying to search for a valid Java 8 version, you can still use it for compile but you have to set the environment variables of your job to use another PATH and JAVA_HOME.

            The option to detect and install java on the Agent will be removed in a next version because as you see it enter on conflict with a core feature.

            Show
            ifernandezcalvo Ivan Fernandez Calvo added a comment - on Jenkins Core 2.112 you can not use Java 7 to run the slave.jar process, since 2.76 you need Java 8 for remoting, because of that it is trying to search for a valid Java 8 version, you can still use it for compile but you have to set the environment variables of your job to use another PATH and JAVA_HOME. The option to detect and install java on the Agent will be removed in a next version because as you see it enter on conflict with a core feature.
            Hide
            dheld Daniel Held added a comment -

            Hi Ivan,

            all is OK now, it runs. I just wanted to give advice. If this whole setup thing was less confusing and a bit better documented, we would not have this issue here.

            Regards,

            Daniel

            Show
            dheld Daniel Held added a comment - Hi Ivan, all is OK now, it runs. I just wanted to give advice. If this whole setup thing was less confusing and a bit better documented, we would not have this issue here. Regards, Daniel
            Hide
            ifernandezcalvo Ivan Fernandez Calvo added a comment -

            I know, my first goal it is to sanitize the code and the documentation there are tons of stuff marked as deprecated.

            Show
            ifernandezcalvo Ivan Fernandez Calvo added a comment - I know, my first goal it is to sanitize the code and the documentation there are tons of stuff marked as deprecated.

              People

              Assignee:
              ifernandezcalvo Ivan Fernandez Calvo
              Reporter:
              dheld Daniel Held
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: