Similar to commands for compiling and running, debugging commands rely on
various information, such as the location of your
sources, the location of the compiled classes and other items on the classpath,
and name of the project's main class.
In , the IDE does not "know"
about any of these things. When you run a command in the IDE (such as Build Project),
the IDE simply calls a target in your build script and lets the script handle
the command. Therefore, for debugging to work, you also have to have a build script
target for debugging. The IDE provides some custom Ant tasks to work with the debugger
and also can generate a basic debug target, which attempts to fill in important
details based on other targets in your script.
To set up debugging in a free-form project, you need to do the following:
Make sure that your classes are compiled with debugging information included. For
example, you might accomplish this in the compile
target of your build script by including the argument debug="true" in the <javac> task.
If the output of a free-form project is on the classpath of another project,
map the free-form project's source packages to their outputs. This ensures that you can use the
debugger to step into the project's sources when you start a debugging session in a
project that has a dependency on the free-form project. You can do this in the Output
panel of the Project Properties dialog box for the free-form project. You can open the
Project Properties dialog box by right-clicking the project's node in the
Projects window and choosing Properties.