Jenkins slave unable to figure out java version

10,218

Solution 1

It is trying to execute "/usr/bin/java -version" at first, then "/usr/java/default/bin/java -version" but both commands seem to be failing. This might be caused by wrong tool location on slave. You should first figure out the java executable location on your slave:

which java

Then, under slave configuration on Jenkins, enable "Tool Locations" checkbox and add your correct Java path there and save.

Solution 2

Check to see which java is on Slave

# which java

Then copy the java path and add it under Advanced configuration of Launch Agents via ssh block.

Manage Jenkins > Manage Nodes and Clouds > Configure node > Advanced section under Launch Agents via ssh block > "update Java path in there"

Share:
10,218
Akash S.
Author by

Akash S.

Updated on June 09, 2022

Comments

  • Akash S.
    Akash S. almost 2 years
    [03/21/16 16:09:39] [SSH] Opening SSH connection to 172.18.73.53:22.
    [03/21/16 16:09:40] [SSH] Authentication successful.
    [03/21/16 16:09:40] [SSH] The remote users environment is:
    [03/21/16 16:09:40] [SSH] Checking java version of java
    Couldn't figure out the Java version of java
    
    [03/21/16 16:09:41] [SSH] Checking java version of /usr/bin/java
    Couldn't figure out the Java version of /usr/bin/java
    [03/21/16 16:09:41] [SSH] Checking java version of      /usr/java/default/bin/java
    Couldn't figure out the Java version of /usr/java/default/bin/java
    

    I am getting the above error on launching the slave