Use jdb for java applications like HelloWorldApp, and pass a -debug flag to appletviewer to debug applets. Before you use the debugger, be sure to compile your application/applet with the -g flag

% javac -g HelloWorld.java

In our example jdb session, we'll use the appletviewer to debug the simple HelloWorld applet:

// Sample HelloWorld applet
//
     import java.awt.Graphics;
     import java.applet.Applet;
 
     public class HelloWorld extends Applet {
         int i;
 
         public void paint (Graphics g){
            i = 10;
            g.drawString("Hello world!", 25, 25);
         }
     }                 
% appletviewer -debug hw.html Good luck