Jenkins installation Windows client - jenkins

This is my first question)
I have a problem with Jenkins installation. As I know it must be installed in the directory with JDK.
I chose this directory, but Jenkins shows me a window: "Invalid Java directory". Hope I'll get a help.

Related

jenkins installation windows 10 “Service Logon Credentials”

I don't know Jenkins at all. I want to install Jenkins on Windows 10. I downloaded the installer and ran it, but I have a problem. I don't know what to enter in the "Account" and "Password" fields on the "Service Logon Credentials" stage.
you can use this link to install Jenkins in windows 10 if you couldn't use the service log on credentials.
https://youtu.be/no98HueS3Ws
Go to https://www.jenkins.io/download/
Download the Generic Java Package(.war)
Create a new folder called jenkins in C drive and move the jenkins.war to that folder
Open command prompt, navigate to the jenkins folder in C drive
Run this war file using the command " java -jar jenkins.war --httpPort=9090"
Jenkins will be downloaded and installed.
You will get an administrator password when you are doing it for the first time.
Copy the password
Open the jenkins in localhost:9090 and give the administrator password
you are now good to go

Unable to locate Jenkins file when Jenkins is installed over Tomcat on Linux Machine

Unable to locate Jenkins file when Jenkins is installed over Tomcat on Linux Machine
I have installed Jenkins(Jenkins.war) on a Linux (RedHat) machine using Tomcat application server.Prior to installation I had set my JENKINS_HOME(in ~/.bash_profile) to /apps/jenkins folder so that Tomcat will install Jenkins on this directory.
Post installation Jenkins is up and running and my jobs are executing fine.However, I need to change JENKINS_USER to other user but I am not able to locate the Jenkins file that will have info like JENKINS_USER and JENKINS_PORT.
I tried searching this file under following directories but no success.
/var/lib/jenkins
/etc/sysconfig
/etc/default
I am not able to find it even in the Jenkins installation directory.
Any help would be appreciated.
Thanks
The files you are searching are only found in the standalone installations of Jenkins through various package managers of different supported Linux distributions for which Jenkins offers packages.
The install of Jenkins in Tomcat is just downloading and copying jenkins.war in Tomcat's webapps folder as a servlet, everything else is managed through Tomcat config files, like setting JENKINS_HOME or changing the port by editing the connector xml for example.
The documentation on running Jenkins as a .war in Tomcat is here. You can see examples on how to change the connector port in $TOMCAT_HOME/conf/server.xml and also JENKINS_HOME in the context. I assume you understand at least how Tomcat works and how to configure it.

How to install jenkins plugins in offline mode

I am sitting behind proxy. I can not bypass it as I am not allowed to download anything on this linux box. I don't have root privilege either.
I have deployed jenkins.war on apache tomcat. Also, downloaded all necessary Jenkins plugins and placed it as shown below:
jenkins
+apache-tomcat-8.5.12/webapps/jenkins
+apache-tomcat-8.5.12/webapps/jenkins.war
+plugins
Can anyone please let me know is there any way I can simply point to 'jenkins/plugins' directory path in some config file to install plugins.
Thanks
On the master
Assuming a .hpi file has been explicitly downloaded, the administrator can manually place the .hpi file in a specific location on the file system.
Copy the downloaded .hpi` file into the JENKINS_HOME/plugins directory on the Jenkins master (for example, on Debian systems JENKINS_HOME is generally /var/lib/jenkins).
The master will need to be restarted before the plugin is loaded and made available in the Jenkins environment.
pay attention for the dependencies plugins some plugins claim other plugins
Jenkins plugins
Finally resolved this issue. Copied all plugins # /home/appuser/.jenkins/plugins. When we deploy jenkins.war on apache tomcat it creates jenkins-home # /home/user/.jenkins

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?
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.
You can set the default credentials for Oracle here:
http://<hostname>/descriptorByName/hudson.tools.JDKInstaller/enterCredential
hostname being your Jenkins URL.
Thanks
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:
In fact, I needed to do the same thing with Maven.
Just set the JAVA_HOME in your Jenkins slave so it doesn't try to install another Java.

Upgrade to Jenkins 2.0 on Windows Server

We are currently running version 1.651.3 on our server and want to upgrade to version 2. From what I can tell online, I just need to run the .msi file and install into the current Jenkins directory and we're good. That didn't work, so I tried stopping the Jenkins service and installing again, but it is still running the old version. What am I missing?
So I didn't realize that you could just download the .war file instead of one of the deployment options. I was clicking Windows and getting the .msi instead of clicking 2.11 .war and getting the .war file. I then dropped this into the C:\Program Files (x86)\Jenkins directory on my server and all was good in the world.

Resources