Location>code7788 >text

Installing Jenkins on Windows 11

Popularity:980 ℃/2024-09-07 09:36:20

Installing Jenkins on Windows 11

1. Download and install JDK11

Starting with Jenkins 2.357, released June 28, 2022, and the LTS version, released September 2022, Jenkins requires Java 11 to work, dropping Java 8. If you use JDK 1.8, then the Jenkins version needs to be prior to the 2.357 version.

JDK11 Download Channel

  • oracle official website:/java/technologies/downloads/#java11

  • Huawei Mirror Station:/openjdk/

 

2. Download and install Jenkins
download address
  • Huawei Mirror Station:/jenkins/

  • AliCloud Mirror:/jenkins/, select the war folder.

mounting
  1. Download the file, click on the file to install, the installation process should pay attention to the following matters

Note 1: Just select the first option here, i.e. local system.

img

Note 2: The default port number is 8080, you can manually change it to another port number, but you need to click the "Test Port" button to test it, and only after it passes can you proceed to the next step.

img

Note 3: Here the path needs to be configured to the corresponding path of the jdk.

img

  1. After installation, you will get the following file, and it will automatically configure a self-starting Jenkins service, you can manually change the automatic to manual startup here.

img

img

3. Modification of the configuration

Opening the log file reveals several issues

Problem 1: jdk installation path has an extra slash \

Problem 2: The webroot parameter points to the C drive

Issue 3: Part of the path "C:\ProgramData\Jenkins\" is not found.

img

  1. Stop the jenkins service and delete all three log files,,.

  2. Notepad open, find JENKINS_HOME corresponding Value value, at this time the value of the corresponding file directory in the C disk, go to the C disk to find the corresponding folder, the folder contains .jenkins and war folder, these two folders cut and paste the folder into the jenkins installation directory, while the C disk can be deleted from the Jenkins folder.

Note: The Jenkins folder exists on the system disk even if it is not pointed to the system disk during installation. In order not to take up too much space on the C disk, you can move it to another disk through the settings.

  1. In it, point the executable tag to the double slash in the path\\ Change to single slash\

img

 

img

img

  1. In it, do the following

  • Replace the absolute path inside the executable tag with an environment variable.

  • Remove %ProgramData%\Jenkins\ from the value value corresponding to the env tag, keeping only .jenkins

  • Correspond the arguments tag to "D:\huanjing\jenkins" in the -jar."Remove and keep only.

  • Corresponds to the arguments tag - "%ProgramData%\Jenkins" in the webroot."Remove and keep only WAR.

  • Remove %ProgramData%\Jenkins\ from the pidfile tag and just keep the

 

img

img

 

  1. Restart the Jenkins service in the service list, you will find that the installation directory will regenerate the log file, open the log file, as shown in the figure, the location of the corresponding startup command has been changed to the D drive, while the PID file because it does not exist will be created by default in the C:\Windows\System32 below.

img

img

 

  1. Open the log file again, change the pidfile tag to "%BASE%\" and save it. At the same time, delete the files under C:\Windows\System32, restart the startup service, at this time, you will find that the C:\Windows\System32 directory will not be generated under the file, at the same time, the installation directory generated files, so that the realization of the file will be migrated to the custom installation directory jenkins.

img

4. Visits

In your browser, typehttp://localhost:8080You can see the following interface, according to the prompts to find the file under the path, copy and paste it into the password box, and then click the Continue button.

img

Choose according to your needs

img

Note: Here the installation of plug-ins may appear as shown below, that is, the installation of all failed, because the server in foreign countries, so you can ignore, the subsequent installation can be completed after the installation of plug-ins again.

img

Create an administrator user, and after entering the information, click the Save and Finish button.

img

Instance Configuration Here, the Jenkins URL text box generates an address by default, keep the default and click the Save and Finish button.

img

Installation completed

img

5. Console interface

img