I have set a breakpoint that allows me to see the value in a field on an object. I'd like to change the value then continue execution, but then I try to edit the value from the variables view, the value field is grayed-out. Is there any way to change variable values while debugging?
Java – How to change the value of a variable while debugging Java code in NetBeans 7.1
debuggingjavanetbeansnetbeans-7.1
Related Topic
- Java – How to get an enum value from a string value in Java
- Java – How to determine whether an array contains a particular value in Java
- Java – How to avoid Java code in JSP files, using JSP 2
- Java – find out the return value before returning while debugging in Intellij
- Java – How to create a memory leak in Java
- Xcode – How to change variables value while debugging with LLDB in Xcode
- Php – Reference – What does this error mean in PHP
- Java – How does the “final” keyword in Java work? (I can still modify an object.)
Best Answer
It is also possible to change the value of the primitive variables and Strings in-place in the Value column of Variables window. To change values of Object variables, you can use "Evaluate Expression..." under menu Debug option (Ctrl+F9).