Thursday, October 14, 2010

Remote Debug an Applet

Remote debug is relatively new to me.  But after a few days of trying, I finally got a hand of it.  Remote debug applet is the easiest and first in success during my experiment.

My environment: Windows 7 64-bit, IE8, JRE 6 Update 21, MyEclipse for Spring.
  1. Go to Start --> Control Panel --> Java (32 bit), this will open the Java Control Panel.
  2. Go to Java Tab and click on View...
  3. Add "-Xdebug -Xrunjdwp:transport=dt_socket,address=9000,suspend=y" to the Runtime Parameters
  4. In Eclipse/MyEclipse, click Debug --> Debug Configurations ... from toolbar.
  5. Add a new configuration under Remote Java Application.  Make sure you use Socket Listen as Connection Type.  Also match the port, which is 9000 in my case.
  6. Now start the Debug Configuration just added, Applet in my case. You'll see in Progress panel that port 9000 is being listened.
  7. Add break point in code and launch the applet.