title: Cannot connect to VM in Eclipse
body: <p>I have suddenly begun getting this weird error when I try to debug any of my projects on Eclipse. I don't remember changing anything for this problem to start so suddenly.</p>
  
  <pre><code>'Launching &lt;my program name&gt;' has encountered a problem.
  Cannot connect to VM.
  </code></pre>
  
  <p>Details of the error:</p>
  
  <pre><code>Cannot connect to VM
  com.sun.jdi.connect.TransportTimeoutException
  </code></pre>
  
  <p>Further, in the console I get the following error:</p>
  
  <pre><code>FATAL ERROR in native method: JDWP No transports initialized, 
  jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
  ERROR: transport error 202: connect failed: Connection timed out
  ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
  JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized     
  [../../../src/share/back/debugInit.c:750]
  </code></pre>
  
  <p>Please tell me how to solve this problem. I have searched the whole web for an answer but to no luck. </p>
  
  <p>I tried the following solutions which worked for other people:</p>
  
  <ol>
  <li>Restarted Eclipse, restarted computer.</li>
  <li><p>Change hosts file in etc\ - Remove the comments (#) sign before 2 lines namely, </p>
  
  <h1>127.0.0.1       localhost</h1>
  
  <h1>::1             localhost</h1>
  
  <p>and restarted.</p></li>
  <li>Turned off all firewalls, restarted Eclipse and retried. Still no luck.</li>
  </ol>
  
  <p>Somebody please help me, I'm going crazy.</p>
  
  <p>Thanks</p>
  
  <p>Sousa</p>