title: Remote Debugging Tomcat 7 with Eclipse Mars on MacOS X
body: <p>I am trying to set-up remote debugging tomcat with Eclipse. As mentioned in this <a href="https://stackoverflow.com/a/3836884/785523">answer</a>. I have added the below lines in my <code>startup.sh</code> at the very start (so that Tomcat always starts in debug mode).</p>
  
  <pre><code>########## Starting Tomcat in Debug mode always #############
  JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n"
  catalina.sh jpda start
  #############################################################
  </code></pre>
  
  <p>In Eclipse I have made the below debug configuration:-</p>
  
  <p><a href="https://i.stack.imgur.com/jjGkI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jjGkI.png" alt="enter image description here"></a></p>
  
  <p>But on launching Eclipse in debug configuration I am getting the below error:-</p>
  
  <pre><code>Failed to connect to Remote VM. Connection Refused.
  </code></pre>
  
  <p>Environment</p>
  
  <ul>
  <li><code>Tomcat - 7.0.75</code></li>
  <li><code>Eclipse - Version: Mars.2 Release (4.5.2)</code></li>
  <li><code>OS - El Capitan Version 10.11.6 (15G1212)</code></li>
  <li><code>Java - 1.8.0_77</code></li>
  </ul>
  
  <p>I have also checked that port 8000 is free by executing the below command:-</p>
  
  <pre><code>tuk-MacBook-Pro-4:bin tuk$ lsof -n -i -a | grep "8000"
  tuk-MacBook-Pro-4:bin tuk$ 
  </code></pre>
  
  <p>Tried with a different port, <code>12345</code> but getting same error.</p>
  
  <p>Can someone let me know what I am doing wrong and how can I do a remote debugging using eclipse with Tomcat 7?</p>