http://sdickinson.com/wordpress/wp-content/themes/HashOne
http://sdickinson.com/wordpress
Obox Signature Series Subscribe to my RSS feed

0 Comments Stepping into Java source with Eclipse

Article written by the brilliant Sam on the 17 Dec 2008 , in the Uncategorized category

This will let you remotely debug an applet using Eclipse.  As far as I know, this will only work with Java 1.6 update 11 and above, but you can have old VM’s installed and only have them enabled (I’ll leave that as an exercise to the reader).

  1. You will need JDK 1.6 update 11 installed (which should install JRE update 11 along with it)
  2. Open your Java Control Panel, go to the Java Tab, and click the view button for Java Applet Runtime Settings
    Applet Settings Window

    Applet Settings Window

  3. Click Find and navigate to your JDK directory (in my case it was C:\Program Files (x86)\Java\jdk1.6.0_11\jre)
  4. Double click the Version field, add something like -debug to the string and disable the other VM’s

    Applet Settings after adding VM

    Applet Settings after adding VM

  5. Add your normal debug parameters in Java Runtime Parameters (in my case -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,address=1235,suspend=n)
  6. Hit Ok/Apply on everything and close the Java Control Panel page
  7. In Eclipse make sure your default JDK is the one specified in the applet runtime settings (in your project properties)
  8. Open the Debug Configurations (under the Run menu), select your particular Remote Java Application, and go to the Source tab
  9. Click Add and select External Archive
  10. Select your src.zip in your JDK directory (in my case C:\Program Files (x86)\Java\jdk1.6.0_11\src.zip)

    Eclipse Debug Window

    Eclipse Debug Window

  11. Press Apply and you should now be able to debug your applet as normal, but with the added bonus of being able to step into the JDK code
Read More Add a Comment