In most programming languages I’ve used, when debugging, when I hit a breakpoint, I have the ability to execute arbitrary code (whatever I type into the console after the breakpoint has been hit).
How do I do this in Eclipse? The debugging mode has, by default, a display console, but no interactive console (into which I can input Java code for immediate execution)
You can use the Display view to execute arbitrary code, access it via:
then type the code you want to execute (you can use
CTRL+SPACEfor autocomplete).to execute the code, select it then:
That should execute the code based on the breakpoint you’ve hit.
Note: As of 2018, Display View has been renamed to Debug Shell View.