Debugger/Exec Options
To run an application you have to specify:
- The main class. This has to be a public class, with the method
"public static void main( String arg[] )" defined.
The classname must be fully qualified ("package.subpackage.name").
- Arguments which should be given to the main class.
E.g., "-runfast -uselessmemory".
- The working directory in which the app should be run
(e.g., if you use relative filenames).
- The classpath needed to let the VM find all necessary classes.
- The VM cline, specifying the name and arguments of the VM used to run
your program.
To debug your application, you have to specify the sourcepath in addition.
The sourcepath should contain all directories containing the sources of classes
used in your project.
To debug "into" the JDK's classes, it is necessary to add the base directory
of your JDK sources to that path.
Note that the program needs to be compiled using "create debug information" in the
Compiler Options.
Important: There where several reports that the jikes compiler
generates invalid debug info, such that the DebugVM crashes. Use javac to compile your programs if you receive debugger
crashes using jikes.
Warning: If a wrong classes.zip is specified in the debuggers classpath, the debugger pops up
and disappears immediately. E.g., you run JDK1.2.1 but have a classes.zip of JDK1.1.8
in the classpath, or you run JDK1.1.8 (SUN) with classes.zip of JDK1.1.8 (IBM). Note that there are distinct
classpathes in AnyJ: one for the compiler, and another one for the debugger.
Warning: If the JDK1.2.x is used, disable the HotSpot-VM on your current JDK.
Warning: You have to apply a patch to the JDK1.2.2 in order to make the
debugger work. Simply drag your JDK1.2.2Home directory onto our "debugger1.2.2patch.bat" located in
[AnyJ installdir].
Alternatively you may do the following:
All classes of tools.jar have to be added to rt.jar:
- extract tools.jar using the jar tool
- extract rt.jar using the jar tool
- pack them again into rt.jar using the jar tool
- replace the original rt.jar by resulting rt.jar
Tip:
If "Run" is performed with the classpath, sourcepath, and working directory textfields left empty, AnyJ will insert default values. These should work for
most projects, or they will serve as a good base configuration to be improved manually.
Tip:
AnyJ creates a script in /tmp/AnyJ/debugger.sh. You can alter this script (e.g. library pathes etc.) and start the debugger using this script.
It will then connect to a running AnyJ to receive breakpoints etc. .