Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins ssh-node doesn't find Java

Tags:

java

ssh

jenkins

I try to connect Jenkins to a windows-machine, but during the connection process Jenkins tells me that it couldn't find java even thought I installed the newest Java-Version.

    [10/19/18 14:00:30] [SSH] Checking java version of /usr/local/java/bin/java
Couldn't figure out the Java version of /usr/local/java/bin/java

java.io.IOException: Java not found on hudson.slaves.SlaveComputer@d671ca. Install a Java 8 version on the Agent.
like image 744
Pascal.S Avatar asked Oct 14 '25 14:10

Pascal.S


2 Answers

Type which java in the slave agent and paste the path in the environment variables of the node in Jenkins

NAME: JAVA_HOME
Value: /usr/bin/java
like image 138
Emjey Avatar answered Oct 17 '25 05:10

Emjey


Java isn't installed for the user that Jenkins is using? Perhaps java is not on the classpath? Is JAVA_HOME set?

Those are the places that I would start by looking

like image 41
Mike Baglio Jr. Avatar answered Oct 17 '25 05:10

Mike Baglio Jr.