7

I have followed the steps to run jenkins as a window service . Followed from URL : https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+as+a+Windows+service

But jenkins is not starting as a window service. When i did some research i found that the problem is with following jenkins.xml file.

Attached as an image.jenkins.xml snapshot

When i change this java keyword to specific jdk path (C:\Program Files\Java\jdk1.8.0_60\bin\java.exe) it works but without this jenkins service not started.

So just wanted to know what is exact meaning of java word inside executable tag?

anoop
  • 71
  • 1
  • 1
  • 2

3 Answers3

2

When jenkins runs as a service, it doesn't run as the current user, but usually as SYSTEM user, so it gets a different PATH environment. Its described here in the first paragraph.

You can change the Logon Account used by the Service to your own user in the service's configuration options.

Dominik Gebhart
  • 2,980
  • 1
  • 16
  • 28
  • 1
    I checked the SYSTEM path variable "C:\ProgramData\Oracle\Java\javapath" was not present. So i have set this and restarted the machine and now jenkins service started successfully. I want to know why this systems variable value was not there in my machine? – anoop Apr 07 '16 at 09:24
  • [Seems](http://stackoverflow.com/a/1690909/3623345) the JDK path doesnt get updated by default. To get a better answer you should post this question as new and add the correct tags to it, so those people who are knowledgable in this field see it. – Dominik Gebhart Apr 07 '16 at 12:55
1

If the executable tag just contains the word 'java' then java is expected to be in your PATH system variable.

So if you were to open a command prompt and type 'java', it should launch java. If it doesn't then Java isn't on your PATH and you will have to specify the full path to the executable, or alternatively add java to the PATH.

Googling "add to path windows" gives plenty of instructions on how to do this.

Mark Chorley
  • 2,087
  • 2
  • 22
  • 29
0

just go to windows firewall -> advanced settings -> inbound Rules -> jenkins -> protocols & ports -> change Protocol type to TCP -> local Port -> specific ports then write 8080. now go to your browser and reload localhost:8080 ...This should work.

BlackBeard
  • 19
  • 1