Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins error: "ERROR: Unable to install JDK unless a valid username/password is provided."

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?

like image 600
Omri Shneor Avatar asked Jul 09 '17 08:07

Omri Shneor


3 Answers

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.

like image 188
sumit singh Avatar answered Oct 22 '22 12:10

sumit singh


You can set the default credentials for Oracle here:

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

hostname being your Jenkins URL. Thanks

like image 27
PRANSHU MIDHA Avatar answered Oct 22 '22 11:10

PRANSHU MIDHA


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.

like image 4
Sridhar Sarnobat Avatar answered Oct 22 '22 11:10

Sridhar Sarnobat