title: Cannot run jenkins cli
body: <p>Using <a href="https://www.youtube.com/watch?v=ooA8RS3hC6k&amp;list=PLhW3qG5bs-L_ZCOA4zNPSoGbnVQ-rp_dG&amp;index=4" rel="noreferrer">this tutorial</a>, I am trying to run Jenkins cli in a windows 10 laptop as shown below. But, I am getting an exception. How do I find out why the exception occurs and how to fix it ?</p>
  
  <p>Note that I first ran my jenkins.war on port 9090. Then, I moved it into tomcat webapps. Tomcat runs on port 8080.</p>
  
  <pre><code>C:\mystuff\jenkins-cli&gt;java -jar jenkins-cli.jar -s http://localhost:9090/
  java.net.ConnectException: Connection refused: connect
          at java.net.DualStackPlainSocketImpl.connect0(Native Method)
          at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
          at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
          at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
          at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
          at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
          at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
          at java.net.Socket.connect(Socket.java:589)
          at java.net.Socket.connect(Socket.java:538)
          at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
          at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
          at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
          at sun.net.www.http.HttpClient.&lt;init&gt;(HttpClient.java:242)
          at sun.net.www.http.HttpClient.New(HttpClient.java:339)
          at sun.net.www.http.HttpClient.New(HttpClient.java:357)
          at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1202)
          at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1138)
          at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1032)
          at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:966)
          at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1316)
          at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1291)
          at hudson.cli.FullDuplexHttpStream.&lt;init&gt;(FullDuplexHttpStream.java:71)
          at hudson.cli.CLI.plainHttpConnection(CLI.java:279)
          at hudson.cli.CLI._main(CLI.java:271)
          at hudson.cli.CLI.main(CLI.java:83)
  </code></pre>