Ever had the misfortune of having to debug Java Applets in combination with a web app?
I recently did, and I thought I might as well share some tips on debugging them in IntelliJ IDEA.
Enable Remote Debugging in Java Plugin
Open Java Control Panel and go to “Java” tab and the click “View”.
In “Java Runtime Parameters” add the following line (one line):
-Djava.compiler=NONE -Xnoagent -Xdebug -Xrunjdwp:transport=dt_socket,address=2502,server=y,suspend=n
(Note, the address can be anything you want it to be, I used 2502)
Add a remote Run Configuration in IntelliJ IDEA
In the menu select “Run” and select “Edit Configurations…”
Click the Plus sign and Select “Remote”
Change the “Port” number to 2502 (or whatever you picked in while enabling remote debugging in the Java Plugin) and select a name for your run configuration.
Debug
Now you are ready to debug. Start up your Applet and then run your new configuration (“Run” and “Name Of Your Run Configuration”
Credit for this information goes to:
http://www.nakov.com/blog/2008/08/20/debugging-java-applets-in-eclipse/
Follow me on Twitter: @gjermundbjaanes