PRB: Breakpoints Not Hit If Class Is Not Preloaded

Last reviewed: January 29, 1998
Article ID: Q165549
The information in this article applies to:
  • Microsoft Visual J++, version 1.0, 1.1

SYMPTOMS

You set a breakpoint in a Java source file before starting the debugging session and Visual J++ does not stop on the breakpoint.

CAUSE

For performance reasons, the debugger pre-loads only the main class of your project. The main class is either the class with the same name as the project or the class you specify in the "Build Menu-Settings-Debug tab- General Category-Class for debugging/executing." If you set breakpoints in other classes via the editor before the classes are loaded, the breakpoints are disabled.

RESOLUTION

Do one of the following to resolve the problem:

  • Specify the class in Project Settings, Debug tab, category Additional Classes, and make sure the first column is checked. This loads the class when the debugging session starts.
  • Right-click on a method in the ClassView pane of the Project Workspace and select "Set Breakpoint" from the Shortcut menu. This causes a break when program execution enters the method.
  • Set the breakpoint after Visual J++ has loaded the class during debugging. You may need to step through your Java source until the class is loaded.

STATUS

This behavior is by design.

MORE INFORMATION

When a breakpoint is set during debugging, the class is preloaded in subsequent debugging sessions and the breakpoint is valid from that point on.

REFERENCES

For the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java, see the following page on the Microsoft Technical Support site:

   http://support.microsoft.com/support/visualj/
   http://support.microsoft.com/support/java/

Keywords          : VJDebug
Technology        : kbInetDev
Version           : 1.0,1.1
Platform          : WINDOWS
Issue type        : kbprb


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 29, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.