Why can't I step into my source code when using the Ant debug target that I generated in the IDE for my free-form project?
If you are unable to step from line to line in your code, but only from breakpoint to breakpoint, the IDE has not been able to find your sources. This is because you have not specified your sources correctly.
- Java classes (e.g., servlets): Choose Window > Debugging > Sources. The Sources window displays all the Java source folders that are available for debugging. If you want to debug a source folder that is not available in the Sources window, specify it in the Project Properties dialog box:
- Right-click the project node, choose Properties, click Java Sources.
- Add the source folders to be debugged to the Source Package Folders table or to the Test Package Folders table.
Note that the target you use for compiling Java classes must specify debug="true" when calling the javac task. If a servlet is compiled without debug info, the debugger will not stop on its breakpoints.
- JSP pages: Make sure that you have defined a context path for the project:
- Right-click the project node, choose Properties, click Web Sources.
- Type the context path. For example, type /MyProject in the Context Path field.
Note that if you have set your breakpoints before specifying the context path, you must remove and reset the breakpoints after specifying the context path. In other words, the context path must be set first.
Also make sure that the sources are correctly specified in the debug.properties file and in the debug-nb target. Note that if your nbproject folder is not housed within the folder that houses your sources folder, the properties containing the path to your Java and web sources should be relative to the value of the project.dir property, such as the following:
Applies to: NetBeans 4.1, 5.x, 6.x