tags:

views:

649

answers:

2

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)

A: 

Eclipse has it indeed. Window->Show View->Interactive Console. Note that you can also execute expressions in the Watch view (e.g. result=false, exception.printStackTrace() etc.).

digitalbreed
My eclipse doesn't have an entry for Interactive Console. Just console. I'll keep poking around - at least I know the feature exists. Thanks.
Aaron F.
I suspect digitalbreed meant just Console. My Fedora Eclipse 3.4.1 installation has no Interactive Console. You can type input there if your program is waiting for input for something to continue. It doesn't execute artibrary code though.
Jay R.
No, I wasn't referring to the Console. But I suspect the Interactive Console I have comes with the Google Plugin... sorry for the confusion.
digitalbreed
+4  A: 
Jon
ah... that's a little clunky. isn't there an interactive-top-level in which I can simply type, and then hit enter and have my code executed? and have an input history of my entries maintained (similar to up/down arrow on any linux command line)?
Aaron F.
It is top level, as long you set it in your debug perspective it'll be there always. You can type an expression into that. I have no idea why you need to select it to execute it. I agree it's a bit clunky... it does what you're asking though :) no history.. ooh err... but you can convert to a watch expression after you've done it so I guess that suffices.
Jon