Starting the Debuggee

The very first thing you are likely to do with JSwat is start debugging your Java code. This is done through one of several means.

The first option is typically the most popular since it involves the least amount of typing and offers the most visual cues for the required information. The rest of this help file will discuss this option exclusively.

The Fields

The input fields of the Start VM dialog are described as follows.

Java Home
This is the directory containing the Java runtime. Typically this is filled in with a default value and does not need to be adjusted. If at some point the location has changed, simply clear the field to have JSwat rediscover the new location automatically (after pressing OK to this dialog). If this fails for any reason, you will need to enter the path to the "jre" directory manually.
JVM Executable
This is the name of the java executable. The default should be acceptable in nearly all cases, but should your case differ, you can change the name to whatever is appropriate for the Java runtime being used.
Debuggee VM Options
These are options to the debuggee JVM, such as -Xxxx, -hotspot, -cp, -jar, and -D. When using the -jar option, you may put the name of the jar file in this field or the Class name field described below. However, the next time the Start VM dialog appears, the jar file name will be in the Class name field.
Set -D Properties
This button presents a dialog for conveniently setting the system properties for the debuggee VM. These are the properties defined using the -Dname=value option. Initially the dialog is populated with any -D properties found in the VM Options field described above. The properties set in this dialog will then appear in the VM Options field after clicking OK in the properties dialog.
Class name and arguments
Like the label says, this is the name of the class to be debugged, along with any arguments expected by that class. If the -jar option is used, this field holds the name of the jar file rather than the name of the class. The jar file must have the Main-Class property set in the manifest for the -jar option to work.

Canonicalized Options

You may recall the option in the "Options" menu for enabling the Classic VM support in the debuggee. With this feature enabled, the -classic option will automatically be used in launching the debuggee. However, the option will not appear in the Start VM dialog's VM Options field. The same is true for the classpath definition. You can define the classpath using the classpath command or the "Set Classpath" dialog, accessible from the "Options" menu, and that will be passed to the debuggee automatically.

Both of these options are automatically added to the set of JVM options given in the Start VM dialog during the launching process, but only under certain conditions. For the Classic VM option, if -client, -hotspot, -server, or -classic option appears in the JVM options field, then the Classic VM feature is silently ignored.

Similarly, if the JVM Options field contains the -cp or -classpath option, the classpath defined via the classpath command or the "Set Classpath" dialog is ignored. Instead, the argument to the -cp or -classpath option is used.

Now What?

After filling in the fields in the Start VM dialog, press the OK button and wait a few seconds. You should soon see the debuggee JVM start up and invoke the main method of the class named in the dialog. Assuming your program does not exit immediately, you are ready to begin debugging.

Now go back to the help index and read more about JSwat under the General Topics section.