title: Can not run Jenkins on Mac
body: <p>I have downloaded Mac OS X native package from Jenkins <a href="http://jenkins-ci.org/" rel="noreferrer">web site</a>, installed it, opened my browser at <a href="http://localhost:8080/" rel="noreferrer">http://localhost:8080/</a> and got error page with this text:</p>
  
  <pre><code>Status Code: 404
  Exception: Request URL / not found.&lt;br&gt;&lt;br&gt;
  Stacktrace:
  Generated by Winstone Servlet Engine v0.9.10 at Tue Nov 29 12:00:52 CET 2011
  </code></pre>
  
  <p>I have found <code>jenkins.war</code> in <code>/Applications/Jenkins</code> and tried running it with <code>java -jar jenkins.war</code>:</p>
  
  <pre><code>$ pwd
  /Applications/Jenkins
  
  
  $ ls
  jenkins.war
  
  $ java -jar jenkins.war
  Running from: /Applications/Jenkins/jenkins.war
  webroot: $user.home/.jenkins
  [Winstone 2011/11/29 12:03:12] - Beginning extraction from war file
  Jenkins home directory: /Users/zeljko/.jenkins found at: $user.home/.jenkins
  [Winstone 2011/11/29 12:03:16] - Winstone shutdown successfully
  [Winstone 2011/11/29 12:03:16] - Container startup failed
  java.io.IOException: Failed to start a listener: winstone.HttpListener
      at winstone.Launcher.spawnListener(Launcher.java:250)
      at winstone.Launcher.&lt;init&gt;(Launcher.java:202)
      at winstone.Launcher.main(Launcher.java:398)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at Main._main(Main.java:268)
      at Main.main(Main.java:96)
  Caused by: java.io.IOException: Failed to listen on port 8080
      at winstone.HttpListener.getServerSocket(HttpListener.java:117)
      at winstone.HttpListener.start(HttpListener.java:70)
      at winstone.Launcher.spawnListener(Launcher.java:241)
      ... 8 more
  Caused by: java.net.BindException: Address already in use
      at java.net.PlainSocketImpl.socketBind(Native Method)
      at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
      at java.net.ServerSocket.bind(ServerSocket.java:328)
      at java.net.ServerSocket.&lt;init&gt;(ServerSocket.java:194)
      at java.net.ServerSocket.&lt;init&gt;(ServerSocket.java:150)
      at winstone.HttpListener.getServerSocket(HttpListener.java:112)
      ... 10 more
  
  Nov 29, 2011 12:03:16 PM jenkins.model.Jenkins$6 onAttained
  INFO: Started initialization
  Nov 29, 2011 12:03:16 PM hudson.WebAppMain$2 run
  SEVERE: Failed to initialize Jenkins
  java.lang.InterruptedException
      at java.lang.Object.wait(Native Method)
      at java.lang.Object.wait(Object.java:485)
      at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:244)
      at jenkins.model.Jenkins.executeReactor(Jenkins.java:816)
      at jenkins.model.Jenkins.&lt;init&gt;(Jenkins.java:730)
      at hudson.model.Hudson.&lt;init&gt;(Hudson.java:81)
      at hudson.model.Hudson.&lt;init&gt;(Hudson.java:77)
      at hudson.WebAppMain$2.run(WebAppMain.java:217)
  </code></pre>
  
  <p>Since the error message says <code>Address already in use</code> I have tried running it on another port:</p>
  
  <pre><code>$ java -jar jenkins.war --httpPort=8081
  Running from: /Applications/Jenkins/jenkins.war
  webroot: $user.home/.jenkins
  [Winstone 2011/11/29 12:11:26] - Beginning extraction from war file
  Jenkins home directory: /Users/zeljko/.jenkins found at: $user.home/.jenkins
  [Winstone 2011/11/29 12:11:27] - HTTP Listener started: port=8081
  [Winstone 2011/11/29 12:11:27] - Winstone shutdown successfully
  [Winstone 2011/11/29 12:11:27] - Container startup failed
  java.io.IOException: Failed to start a listener: winstone.ajp13.Ajp13Listener
      at winstone.Launcher.spawnListener(Launcher.java:250)
      at winstone.Launcher.&lt;init&gt;(Launcher.java:203)
      at winstone.Launcher.main(Launcher.java:398)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at Main._main(Main.java:268)
      at Main.main(Main.java:96)
  Caused by: java.io.IOException: Failed to listen on port 8009
      at winstone.ajp13.Ajp13Listener.start(Ajp13Listener.java:92)
      at winstone.Launcher.spawnListener(Launcher.java:241)
      ... 8 more
  Caused by: java.net.BindException: Address already in use
      at java.net.PlainSocketImpl.socketBind(Native Method)
      at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
      at java.net.ServerSocket.bind(ServerSocket.java:328)
      at java.net.ServerSocket.&lt;init&gt;(ServerSocket.java:194)
      at java.net.ServerSocket.&lt;init&gt;(ServerSocket.java:150)
      at winstone.ajp13.Ajp13Listener.start(Ajp13Listener.java:87)
      ... 9 more
  
  Nov 29, 2011 12:11:27 PM jenkins.model.Jenkins$6 onAttained
  INFO: Started initialization
  Nov 29, 2011 12:11:27 PM hudson.WebAppMain$2 run
  SEVERE: Failed to initialize Jenkins
  java.lang.InterruptedException
      at java.lang.Object.wait(Native Method)
      at java.lang.Object.wait(Object.java:485)
      at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:244)
      at jenkins.model.Jenkins.executeReactor(Jenkins.java:816)
      at jenkins.model.Jenkins.&lt;init&gt;(Jenkins.java:730)
      at hudson.model.Hudson.&lt;init&gt;(Hudson.java:81)
      at hudson.model.Hudson.&lt;init&gt;(Hudson.java:77)
      at hudson.WebAppMain$2.run(WebAppMain.java:217)
  </code></pre>
  
  <p>But I get <code>Address already in use</code> error message, it does not matter which port I try.</p>
  
  <p>I have stopped Firewall, just in case (System Preferences > Security > Firewall > Stop). It did not help.</p>
  
  <p>I have copied <code>jenkins.war</code> to <code>/Users/zeljko/Jenkins</code> and tried running it with <code>java -jar jenkins.war</code> and <code>java -jar jenkins.war --httpPort=8081</code>. The same error messages.</p>
  
  <p>I have downloaded <a href="http://mirrors.jenkins-ci.org/war/latest/jenkins.war" rel="noreferrer">Latest and greatest (1.441) jenkins.war</a> from the web site, moved it to <code>/Users/zeljko/Jenkins</code>, and tried  <code>java -jar jenkins.war</code> and <code>java -jar jenkins.war --httpPort=8081</code>. The same error messages.</p>
  
  <p>Environment:</p>
  
  <p>Mac OS X 10.6.8</p>
  
  <pre><code>$ java -version
  java version "1.6.0_29"
  Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-10M3527)
  Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
  </code></pre>
  
  <p>I am browsing Jenkins <a href="http://jenkins-ci.org/" rel="noreferrer">web site</a>, <a href="https://wiki.jenkins-ci.org/display/JENKINS/Home" rel="noreferrer">wiki</a>, <a href="http://www.wakaleo.com/books/jenkins-the-definitive-guide" rel="noreferrer">book</a>, searching around, but I just do not get what I have to do to get it working.</p>