Skip to main content.
August 20th, 2008

Debugging Java Applets in Eclipse

Today I needed to debug Java applet running in Internet Explorer from Eclipse. I was not straightforward. Let me share the experience how to do this:

1) First enable remote debugging in the Java Plugin:

a) Start –> Settings –> Control Panel –> Java –> Java Applet Runtime Settings –> View

b) Add the following to the “Java Runtime Parameters”:

-Djava.compiler=NONE -Xnoagent -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

Java Plugin - Runtime Settings

This will enable remote debuging on TCP port 8000 for all applications running inside the Java Plugin (in Internet Explorer). Make sure this port is not used by other applications.

3) Close all Web browser Windows

4) Put breakpoints in your source code (you need to have an Eclipse project containing the applet source code)

4) In Eclipse create a remote debugging configuration:

a) Run –> Open Debug Dialog –> Remote Java Application –> New

b) Assign host = localhost and port = 8000

Eclipse - Remote Debug Configuration

Press the “Debug” button and enjoy debugging.

Note: Don’t forget to build your applet with debug information (javac -g). I am buidling my applet with ant so I just added <javac debug=”true” … />.

Posted by nakov in java

This entry was posted on Wednesday, August 20th, 2008 at 6:53 pm and is filed under java. You can follow any responses to this entry through the comments RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.