Follow below steps one by one to setup Jenkins on your windows machine
If you are on Mac OS, then refer Mac jenkins setup
- Jenkins.war file download – Latest release, Stable releases
- Place .war file under a specified folder (say C:\Jenkins)
- SHIFT + right click on the folder, click on “Open command prompt window here”
- Enter below command and press enter (to open jenkins server)
java -jar jenkins.war
You should see a message on your command prompt –
INFO: Jenkins is fully up and running
- Open any browser and enter url –
You will see a screen as below to enter the passcode
Navigate to the specified location and copy the content from the initialAdminPassword and paste under the password box, click Continue
- After continue, it will prompt to install the plugins, select install suggested plugins and click install
- After plugins installed, click Continue [no problem if few of the plugins not installed], enter user details & click on Save and continue
- Login with your user credentials
- Click on “New Item”, enter name, choose “Freestyle project” and click on “OK”
- Create a .bat file to run on jenkins
Open notepad and type
echo Run selenium on jenkins
Save it under “C:\Jenkins” with file name “Test.bat”
- Under “Source Code Management” tab, Build section, Select “Execute Windows batch command” from “Add build step”
- Click on save
- Click on “Build Now” to run the bat file.
- Under Build History, new build with number appears, click on latest build
- Click Console OutPut to see the output.
Started by user admin Building in workspace C:\Users\SP\.jenkins\jobs\testJenkins\workspace<br><br> [workspace] $ cmd /c call C:\Users\SP\AppData\Local\Temp\hudson3227077592658874014.bat C:\Users\SP\.jenkins\jobs\testJenkins\workspace>c:\Jenkins\Test.bat C:\Users\SP\.jenkins\jobs\testJenkins\workspace>echo Run selenium on jenkins Run selenium on jenkins Finished: SUCCESS
Will it work with Java 15 (Jdk 15)?
I didn’t try on Java 15, but I am sure it will work with that java version, you just want to use the java command,
and if you are on windows OS, then just make sure you have java command accessible globally!