house fly

JSwat Project

How To: Launching JSwat


Invoking JSwat

Invoking by Classname

Before proceeding, be sure to read the JSwat Installation instructions. This section assumes that you have added the JSwat jar file to your classpath.

Starting JSwat is very simple. You start JSwat by invoking the 'java' command from the command line, like so.

    java [1] com.bluemarsh.jswat.Main [2]

The arguments inside [ ] are optional and are described as follows.

Arguments Description Examples
[1] These are the arguments to the JVM that runs JSwat. -hotspot
-Djava.source.path=<source-path>
[2] Command and its arguments to be interpreted. load -client MyClass arg1 arg2
attach ahost:1234

Invoking by Jar File

Another common way to launch JSwat is through the -jar option to the java command. The argument to -jar is the name of the JSwat jar file. This is very convenient since you do not have to put the JSwat jar file in the classpath. However, one very annoying problem with the -jar option is that it ignores every way that you might specify your classpath, such as through the CLASSPATH environment variable. Passing -cp or -classpath on the command line will also not work.

This issue becomes quite obvious if you have specified the location of the JPDA jar file using the CLASSPATH environment variable. The only solution to this is to put the JPDA jar file in the jre/lib/ext directory of your JDK installation. This is described in the installation instructions.

As with launching via the class name, described in the section above, you can pass arguments to JSwat. The format is like so:

    java [1] -jar jswat-<date>.jar [2]

The arguments inside [ ] are optional and are described in detail in the section above.



Back to Documentation