General Setup for Java

This is the general setup for debugging Java Applications. You have two options when debugging.

Debug an Application
Attach to an application that is running

Option 1 - Debug an Application

Field

Action

See also

Debugger

Select Java.

 

 

Mode

Select Run.

 

Default Directory

This path is added to the class path property when the Java Virtual Machine is created.

 

Application Class

Identify the fully qualified Class name to debug; the Class must have a method declared with the following signature:

 

public static void main(String(  ) );

 

clip0002

 

Command Line Arguments

Specify any parameters to be passed to the main method of the Application Class above.

Parameters containing spaces should be surrounded with double quotes.

 

Java Virtual Machine Options

Specify command line options for Virtual Machine creation.

You also must provide a parameter (jre) that is a path to be searched for the jvm.dll; this is the DLL supplied as part of the Java runtime environment or Java JDK from Sun MicrosystemsTM.

clip0001

In the example above, a virtual machine is created with a new Class path property that comprises any paths named in the CLASSPATH environment variable plus the default directory.

If no Class path is specified, the debugger always creates the virtual machine with a Class path property equal to any path contained in the environment variable plus the path entered in the default working directory of this script.

If source files and .class files are located under different directory trees, the Class path property MUST include both root path(s) to the source and root path(s) to binary class files.

 

Option 2 - Attach to Virtual Machine

There is very little to specify when attaching to a VM; however, the VM must have the Sparx Systems debugging agent loaded.

Field

Action

See also

Debugger

Select Java

Attach to Virtual Machine

Debug Tomcat Server

Debug Another Process

Mode

Select Attach to Virtual Machine

Learning Center topics

(Alt+F1) | Build and Debug | Debug | Java