0

I want to start Jenkins on 9090,

I searched for it and I saw the solutions: like in this post

And as in the answer I start it with

java -jar jenkins.war --httpPort=9090

It worked good. But, when I stop Jenkins with the command

jenkins.exe stop

And start it again with command:

jenkins.exe start

It starts on 8080 instead of 9090 again. Whenever I run it with java -jar jenkins.war --httpPort=9090 everytime I need to install jenkins again and again. I just want to use simple start and stop commands as in the example without going to 8080.

Why does it happen or how can I configure it to start and stop with jenkins.exe start/stop always on 9090 ?

Note:I am using Windows

abidinberkay
  • 1,857
  • 4
  • 36
  • 68
  • [Answered already here](https://stackoverflow.com/q/23769478/598141). Also, jenkins.exe start is not the same as java -jar jenkins.war – Ian W Jun 24 '20 at 10:18

1 Answers1

0

Configure Windows environment variable JENKINS_HOME

Default JENKINS_HOME is C:\Users\<username>\.jenkins

If you navigate to this path, you can find all your jobs, workspaces, all the stuff you had created earlier in Jenkins.

Now, when you install Jenkins on port 9090 (or any port) using command java -jar jenkins.war --httpPort=9090, Jenkins picks up "JENKINS_HOME" variable and all your stuff is loaded from previous installation.

saurabh14292
  • 1,281
  • 2
  • 10
  • 12