title: How to have Eclipse Remote Debugger keep listening on port until a JVM finally connects?
body: <p>I have a complicated application with several different JVMs. </p>
  
  <p>JVM 1 does about 5 minutes of work and then fires off another JVM2 to do some extra work.</p>
  
  <p>I want to Debug JVM2. So I turn on a remote socket debugger on JVM2's startup script:</p>
  
  <p><code>-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000</code></p>
  
  <p>And I set up my Eclipse Remote Debug Session like this: </p>
  
  <p>Connection Type: Standard (Socket Attach), Host: localhost, Port: 8000</p>
  
  <p>If I wait for JVM2 to start, then launch the debugger, it works fine.</p>
  
  <p>However it is REALLY hard to pay enough attention to click the debugger after 5 long minutes of waiting. </p>
  
  <p>If I launch the remote debugger before JVM2 is on... I get</p>
  
  <pre><code>Failed to connect to remote VM. Connection refused.
  Connection refused: connect
  </code></pre>
  
  <p>Is there someway to have the Remote Debugger continuously try to connect? </p>
  
  <p>I tried to use the Eclipse Remote Debug Connection Type: <code>Socket Listen</code> but this blocks the port and JVM2 gives this error on startup:</p>
  
  <pre><code>FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=JVMTI_ERROR_INTERNAL(113)
  ERROR: transport error 202: bind failed: Address already in use ["transport.c",L41]
  ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) ["debugInit.c",L500]
  JDWP exit error JVMTI_ERROR_INTERNAL(113): No transports initialized
  </code></pre>
  
  <p>How can I have the remote debugger try over and over and over again? </p>