If you find a problem while debugging, you can fix your source and then continue debugging with the changed code without restarting your program. The .java file and the .class file must be in the same directory.
The Fix command is available if both the IDE and the debugged application are running software that supports the technology that is known as HotSwap in the Java 2 Standard Edition APIs. Java 2 Platform, Standard Edition, SDK 1.4 software supports HotSwap for fixing bodies of methods and fields.
When running on J2SE 1.4 software, it is not possible to use the Fix command to do the following:
To fix your code:
The source code is recompiled. If there are errors while compiling, nothing is changed in your program. Edit your source code as needed. Then execute the Fix command again.
If there are no errors, the resulting object code is swapped into the currently executing program. However, all calls on the call stack continue running the unfixed code. To use the modified code, you must pop from the call stack any calls that contain modified code. When the calls are re-entered, they use the modified code.
If the most recent call belongs to the changed class, an alert box is opened. If you click the Pop Call button, the most recent call is removed from the current call stack. If you click the Leave Call button, the program will execute with the original version of the code. If there is only one call in the stack, you can not pop the call and continue.
![]() |
The Fix command does not automatically rebuild JAR files, executable files, or similar files. You must rebuild these files if you want to debug them in a new session. |
See Also | |
---|---|
Stepping Through Your Program Popping a Call From the Call Stack |