Documentation Archive Developer
Search
PATH  Documentation > WebObjects 4.5 > Creating a Java Client Application: A Tutorial

   

Debugging Client Code

Project Builder currently provides no support for debugging the client side of a Java Client application. Instead, use the Java debugger jdb (included with the JDK) in a shell window.

Before you can debug client code, compile your Java classes with the -g flag specified. To do this, either "make debug" your project or enter OTHER_JAVAC_FLAGS=-g as a build argument in Project Builder's Build Options panel.

Once your code has compiled, start up the client application with appletviewer or with the java interpreter (see " Running a Java Client Application " in the tutorial) with the -debug flag . These tools then print a "password" that you can use later to attach jdb to your client application. To attach jdb, open another shell and enter the following command:

jdb -password password

Please refer to the jdb documentation for information on setting breakpoints and performing other debugging tasks. As with running an application, your CLASSPATH environment variable has to specify the location of all Java classes used in your application.

If you don't want to attach to a running client application, you can start up jdb using appletviewer or the interpreter through a class name, for example:

jdb sun.applet.AppletViewer URL

jdb com.apple.client.eointerface.EOApplication URL

The advantage of starting up jdb like this is that you can set breakpoints before your application is executed; jdb stops before it executes the main function of the given class.

Note:   Use the -WOAutoOpenInBrowser NO flag when starting up your server application to prevent the client application from automatically launching in your default browser.


© 1999 Apple Computer, Inc. – (Last Updated 13 Sep 99)