15

I have added a new slave to my jenkins server, the connection itself seemed to go successfully via ssh, however when I try to build on that server the Job tries to download Java on the slave(even though java is all-ready installed on that server) and im getting the following Error:

Downloading JDK from http://download.oracle.com/otn/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz Your Oracle account doesn't appear valid. Please specify a valid username/password ERROR: Unable to install JDK unless a valid username/password is provided. Finished: FAILURE

This is the output of java -version

openjdk version "1.8.0_131" OpenJDK Runtime Environment (build 1.8.0_131-b12) OpenJDK 64-Bit Server VM (build 25.131-b12, mixed mode)

what do I need to do here? reinstall java manually?

Omri Shneor
  • 965
  • 3
  • 18
  • 34

4 Answers4

22

I was stuck with same error, banged my head for hours but no luck. But finallly the answer was jdk configuration on the master jenkins.

Writing this answer as i couldnt find much on this over internet.

  • Go to Manage Jenkins -> Global tool configuration and check the configuration for JDK in JDK installation.

  • Uncheck the install automatically checkbox as this will be forcing jdk installations on every slave.

If you want this option enabled then you have to give oracle account credentials which to be used by the jenkins to download the jdk.

If you already have java installed on your slaves then you would be better to uncheck the checkbox.

random-parts
  • 2,137
  • 2
  • 13
  • 20
sumit singh
  • 522
  • 4
  • 9
17

You can set the default credentials for Oracle here:

 http://<hostname>/descriptorByName/hudson.tools.JDKInstaller/enterCredential

hostname being your Jenkins URL. Thanks

PRANSHU MIDHA
  • 472
  • 7
  • 13
4

Tool Locations

The above two answers didn't work for me. But this did: at the bottom of your node configuration page, set one of your tools to be your JDK:

enter image description here

In fact, I needed to do the same thing with Maven.

Sridhar Sarnobat
  • 25,183
  • 12
  • 93
  • 106
3

Just set the JAVA_HOME in your Jenkins slave so it doesn't try to install another Java.

arifCee
  • 509
  • 2
  • 12