6 Steps to Install Jenkins on Windows
1. Install Java Development Kit (JDK)
- Download JDK 8 and choose windows 32-bit or 64-bit according to your system configuration. Click on "accept the license agreement."
2. Set the Path for the Environmental Variable for JDK
- Go to System Properties. Under the "Advanced" tab, select "Environment Variables."
- Under system variables, select "new." Then copy the path of the JDK folder and paste it in the corresponding value field. Similarly, do this for JRE.
- Under system variables, set up a bin folder for JDK in PATH variables.
- Go to command prompt and type the following to check if Java has been successfully installed:
C:\Users\Simplilearn>java -version
3. Download and Install Jenkins
- Download Jenkins. Under LTS, click on windows.
- After the file is downloaded, unzip it. Click on the folder and install it. Select "finish" once done.
4. Run Jenkins on Localhost 8080
- Once Jenkins is installed, explore it. Open the web browser and type "localhost:8080".
- Enter the credentials and log in. If you install Jenkins for the first time, the dashboard will ask you to install the recommended plugins. Install all the recommended plugins.
5. Jenkins Server Interface
- New Item allows you to create a new project.
- Build History shows the status of your builds.
- Manage System deals with the various configurations of the system.
6. Build and Run a Job on Jenkins
- Select a new item (Name - Jenkins_demo). Choose a freestyle project and click Ok.
- Under the General tab, give a description like "This is my first Jenkins job." Under the "Build Triggers" tab, select add built step and then click on the "Execute Windows" batch command.
- In the command box, type the following: echo "Hello... This is my first Jenkins Demo: %date%: %time% ". Click on apply and then save.
- Select build now. You can see a building history has been created. Click on that. In the console output, you can see the output of the first Jenkins job with time and date.
Congratulations, you've just installed Jenkins on your Windows system!