Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change the value of a variable while debugging Java code in NetBeans 7.1?

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?

like image 734
braveterry Avatar asked Jan 31 '12 21:01

braveterry


1 Answers

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).

like image 87
John Mikic Avatar answered Oct 11 '22 09:10

John Mikic