Friday, June 10, 2022

Jenkins installation on Windows

 Hello DevOps Guys, We will install the Jenkins Controller on the Windows machine. 

How to install Jenkins on Windows machine?

Here in this post we will explore Step-by-Step installation instructions for Jenkins on Windows platform.

Jenkins installation on Windows


Step 1: Install and set Java

Please visit the Oracle Java SE download page:  http://www.oracle.com/technetwork/java/javase/downloads/index.html .

Oracle providing the new option on the download page, that is "JDK Script Friendly URLs" page. Choose the JDK for your operating system (Windows 10 or 11) 64bit to download. Double click downloaded file launches installer wizard, proceed with the agree and set up the installation location as per your disk/drive availability.

Verification of Java installation 

Open a CMD prompt run "java -version" if Java installed correctly in the PATH you will get the installed version as output. if not set the PATH from the type ENVIRONMENT VARAIABLES search ->EDIT ENVIRONMENT VARAIABLES in the USER VARIABLES section add new variable as JAVA_HOME -> C:\Program Files\Java. and then set PATH with %JAVA_HOME%\bin;%PATH% and launch a fresh CMD prompt and re-test.

java -version
Setting JAVA_HOME path manually on your CMD
SET JAVA_HOME="C:\Program Files\Java\jdk-11.0.14"
SET PATH= %JAVA_HOME%\bin;%PATH%
java -version
should return Java version as jdk-11.0.14.
Checking Java version on Windows Command Prompt

Once Java all set then next we are good to go for Jenkins download.

Step 2: Download and install Jenkins

I believe that a Picture tells 1000 words of worth!  visit jenkins download page link, you may be on Windows 10 or 11(At the time of this blog post Windows versions). 

Jenkins download for Windows

2.1 Welcome Screen

 
2.2 Provide the destination folder where Jenkins need to install


2.3 Choose the user credentials option

2.4 Choose a port for Jenkins service to run and click on "Test Port" will check the availability for the port


2.5. Select the Java installed path [JDK 1.8 or 11 supported choose accordingly]


Note: Please choose JDK 11, This step leads me to run into errors which I've explained in the troubleshoot section. 

2.6 Custom Setup, Next

2.7 Ready to install Jenkins 2.x.x. Click on Install button.

2.8 Completed Jenkins setup, Click on Finish button.

Jenkins completed setup 




Step 3: How to run Jenkins server on Windows?

To start the Jenkins using jankins.war file you have to navigate to the Jenkins installed path then run the following
cd "C:\Program Files\Jenkins"
java -jar jenkins.war
usually in Windows defender will pop-up the security concern. You can select "Allow access".

Jenkins start using java jar command defender firewall protection


If you wish to use different port for your Jenkins server
java -jar jenkins.war --httpPort=9090

Step 4: Launch the Jenkins Controller on Browser

To access on the browser this Jenkins Master console on the Windows machine you can use the URL as either localhost:8080 or 127.0.0.1:8080 or YOURCOMPUTERNAME:8080

Jenkins console access on Windows machine

Please enter the file content as shown the path for initialAdminPassword and click on the continue button,  which will prompt for plugin installation screen then proceed for Admin User setting. Ser the user and password and remember credentials.

Troubleshoot Jenkins issues

Issue 1: Windows service start fails immediately without any log message. 

Jenkins service stopped when started

Basic investigation you could  try to trigger jenkins service from the CMD prompt, On windows you can start any of the service from the COMMAND prompt as follows

net start jenkins
Trouble in starting Jenkins from the CMD prompt

This above screen tells something wrong in the Jenkins system requirement does not allowing to start the Jenkins service. You could do look into the jenkins.out log file present in the Jenkins installed location. Check the reason why it is failed to start. Here I found the reason is JDK Unsupported version.

Issue 2: Jenkins failed to start cause Unsupported Java version

Cause: Here if you see the JDK version used 18.0.1.1 where as Jenkins is comfortable with JDK1.8 or 11 versions same thing in the error message.


The Fix: Uninstall the JDK 18.0.1.1 from your Control Panel. Install the compatible Java either 1.8 or 11 version and then launch Jenkins. This is only applicable this year may be next year another JDK version will be supported by Jenkins!


If you like this post please share with your tech teams & friends...


2 comments:

Pranav Sai said...

Thankyou it was very usefull!!!

BHARAT said...

Nice information explained in a simple way

Categories

Kubernetes (24) Docker (20) git (13) Jenkins (12) AWS (7) Jenkins CI (5) Vagrant (5) K8s (4) VirtualBox (4) CentOS7 (3) docker registry (3) docker-ee (3) ucp (3) Jenkins Automation (2) Jenkins Master Slave (2) Jenkins Project (2) containers (2) create deployment (2) docker EE (2) docker private registry (2) dockers (2) dtr (2) kubeadm (2) kubectl (2) kubelet (2) openssl (2) Alert Manager CLI (1) AlertManager (1) Apache Maven (1) Best DevOps interview questions (1) CentOS (1) Container as a Service (1) DevOps Interview Questions (1) Docker 19 CE on Ubuntu 19.04 (1) Docker Tutorial (1) Docker UCP (1) Docker installation on Ubunutu (1) Docker interview questions (1) Docker on PowerShell (1) Docker on Windows (1) Docker version (1) Docker-ee installation on CentOS (1) DockerHub (1) Features of DTR (1) Fedora (1) Freestyle Project (1) Git Install on CentOS (1) Git Install on Oracle Linux (1) Git Install on RHEL (1) Git Source based installation (1) Git line ending setup (1) Git migration (1) Grafana on Windows (1) Install DTR (1) Install Docker on Windows Server (1) Install Maven on CentOS (1) Issues (1) Jenkins CI server on AWS instance (1) Jenkins First Job (1) Jenkins Installation on CentOS7 (1) Jenkins Master (1) Jenkins automatic build (1) Jenkins installation on Ubuntu 18.04 (1) Jenkins integration with GitHub server (1) Jenkins on AWS Ubuntu (1) Kubernetes Cluster provisioning (1) Kubernetes interview questions (1) Kuberntes Installation (1) Maven (1) Maven installation on Unix (1) Operations interview Questions (1) Oracle Linux (1) Personal access tokens on GitHub (1) Problem in Docker (1) Prometheus (1) Prometheus CLI (1) RHEL (1) SCM (1) SCM Poll (1) SRE interview questions (1) Troubleshooting (1) Uninstall Git (1) Uninstall Git on CentOS7 (1) Universal Control Plane (1) Vagrantfile (1) amtool (1) aws IAM Role (1) aws policy (1) caas (1) chef installation (1) create organization on UCP (1) create team on UCP (1) docker CE (1) docker UCP console (1) docker command line (1) docker commands (1) docker community edition (1) docker container (1) docker editions (1) docker enterprise edition (1) docker enterprise edition deep dive (1) docker for windows (1) docker hub (1) docker installation (1) docker node (1) docker releases (1) docker secure registry (1) docker service (1) docker swarm init (1) docker swarm join (1) docker trusted registry (1) elasticBeanStalk (1) global configurations (1) helm installation issue (1) mvn (1) namespaces (1) promtool (1) service creation (1) slack (1)