I have jenkins.war and I started it from command prompt in Windows as:
java -jar jenkins.war
It was started well and easily browsed as
Open Command Prompt as Administrator in Windows . Go to the directory where Jenkins is installed. and stop the Jenkins service first, using jenkins.exe stop
type the command to change the port using, java -jar jenkins.war --httpPort=9090 (enter the port number you want to use).
and at-last, restart the Jenkins services, using jenkins.exe restart
To change the default port of 8080. All you need to do:
<arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=9090</arguments>
In CentOS/RedHat (assuming you installed the jenkins
package)
vim /etc/sysconfig/jenkins
....
# Port Jenkins is listening on.
# Set to -1 to disable
#
JENKINS_PORT="8080"
change it to any port you want.
Correct, use --httpPort parameter. If you also want to specify the $JENKINS_HOME, you can do like this:
java -DJENKINS_HOME=/Users/Heros/jenkins -jar jenkins.war --httpPort=8484
On OSX edit file:
/usr/local/Cellar/jenkins-lts/2.46.1/homebrew.mxcl.jenkins-lts.plist
and edit port to you needs.
For the benefit of Linux users who find themselves here: I found /etc/sysconfig/jenkins has a JENKINS_PORT="8080", which you should probably change too.