I have added a new agent to my Jenkins controller, 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 I'm 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?
I was stuck with same error, banged my head for hours but no luck. But finally the answer was JDK configuration on the Jenkins controller.
Writing this answer as I couldn't 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 agent.
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.