Command Line of Included JTrek Applications

To run one of these applications (and any Trek application that uses trek.getCmdLine), give a command line of the form:

jvm [jvm switches] application-name base-classes [application-args and switches]

The red part of the command line is processed by the operating system and the Java virtual machine, and the blue part by the Trek application itself. For example in the command line java –classpath c:\jtrek dump dec.trek.Statement –sc pkg, the operating system and the JVM process java –classpath c:\jtrek dump, and the dump application processes dec.trek.Statement –sc pkg.

The base-classes argument and the following switches are accepted by all the Jtrek applications:

base-classes
The classfiles to read, separated by semi-colons. Each specified classfile must be fully qualified and its letters must have the proper case. Additional classfiles may be read, depending on the use of the –sc switch.

-debug
If an error was logged in trek.log and you think it indicates a bug in the application, rerun the application with this switch set (to cause a stack trace to be logged as well). Then report the bug as described in the JTrek Product Information.

-ip pathlist
The locations where the trek should look for packages, separated by semi-colons. As with classpaths for  java, a location can be "." (which means the current directory), a directory spec, or the filespec of a .jar or .zip file. Also, the last location of pathlist can be "+", which means append the JVM’s classpath.

If an -ip switch is not specified, the trek uses the JVM’s classpath.

If you are running a trek application under jview, and you want to scan .jar and zip files that are in a directory of   jview's classpath, you must specify an -ip switch and include each of them in pathlist. (jview classpaths contain only directories, and it supports .jar and zip files by processing all .jar and zip files in the directories of its classpath).

-op directory
The directory that the trek should use for creating output files. For example, the dump application outputs .dmp files to this directory.

Applications that create instrumented classfiles (such as the included applications, profile and watch) output them under this directory. For example, if java.util.Vector was instrumented, the instrumented Vector.class would be output to directory\java\util -- and these directories would be created first if necessary.

If -op directory is not specified, directory defaults to the current directory. This can be convenient, but it does create certain issues.

-sc scope
This determines the additional classfiles read by the application. If this switch is omitted, only the classes in base-classes are read. When -sc is specifed, base-classes is most commonly the main class of the program you want to scan. This is because a program's main class directly or indirectly references all the classes of the program.

Scope may be:

    • pkg, which means read all classes used within the packages identified by base-classes.
    • p1, which means read all classes used within the packages identified by base-classes, plus any classes they directly reference. That is, the scope of the trek includes "one level" beyond the identified packages.
    • user, which means read all used classes except those in the java package.
    • u1, which means read all used non-java. classes, plus any classes they directly reference. That is, the scope of the trek includes "one level" into the java package.
    • all, which means read all used classes.

-verbose
Causes the trek to output Reading classfile, Scan at classfile, and Writing classfile messages as these actions are performed in the trek.