JBuilder 4: How can I debug my OpenTools?

By: Josh Fletcher

Abstract: How to debug your OpenTool Projects in JBuilder 4.


Question:

How can I debug my OpenTools in JBuilder 4?

 
Answer:

UPDATE: Look for the latest information on OpenTools debugging from Blake Stone, Borland's chief scientist, here:

http://homepages.borland.com/bstone/articles/debugopentools.html

This FAQ describes possible scenarios for debugging your OpenTools in JBuilder 4. There are essentially two ways to do this:

  • Use a dynamic class loader to load the OpenTool and debug it.
  • Launch a second instance of JBuilder in debug mode and debug the whole IDE.

There is a sample included with JBuilder 4 that can allow you to use the first technique ("samples/opentools/miscellaneous/DynamicClassLoader"). There is also an extension of this sample written by Borland TeamB member John McGrath, available here:

http://www.JPMcGrath.net/

Follow these steps to use the second technique:

  1. In your OpenTool project, set the main class to com.borland.jbuilder.JBuilder.

  2. Define a Library named JBuilder4 and in that definition include every jar file found in the JBuilder lib directory (and possibly the lib/ext directory if any of those are required by your tool.)

  3. Set the Application Parameters to:

    -verbose -nosplash

    Set the VM Parameters to:

    -Xms8m -Xmx128m -Xbootclasspath/p:<path to lawt.jar>

    For example:

    -Xms8m -Xmx128m -Xbootclasspath/p:/home/joe/jbuilder4/lib/lawt.jar

    -Xms8m -Xmx128m -Xbootclasspath/p:C:/jbuilder4/lib/lawt.jar

    Of course the path to lwtoolkit.jar will be different on your system so adjust it accordingly.

Now, when you run this project, your primary IDE will launch a child copy of JBuilder using the parameters provided by the project settings. You will get a second browser window, in which you can test your OpenTool. In the Primary IDE's message pane you will see any exceptions JBuilder may throw when loading your opentool.

 

Server Response from: SC1