Immediate Window for Eclipse
23,865
Solution 1
Eclipse has a really cool concept call Scrapbook Pages where you can evaluate statements even when you're not debugging. However, if you want to eval code using values from the current program, go to Window->Show View->Expressions. There you can put in any expression you want and track it as your program executes.
Solution 2
Yes. The view name is "Display".
Window->Show View->Other It is under the Debug folder.
Once in there you evaluate statements while in the debugger.
Solution 3
Inspect ctrl-shift-i or Display ctrl-shift-d?
Comments
-
Justin R. almost 4 years
Does Eclipse have an analog to Visual Studio's "Immediate Window", a window where I can evaluate statements while in the debugger?
-
Justin R. almost 15 yearsExpressions are pretty close. Thanks!
-
Rich Seller almost 15 yearsTo clarify, you can highlight some code within the debugger and hit ctrl+shift+i or right-click->inspect to see the evaluation of the code
-
Michal almost 15 yearsi would recommend updating this as the correct answer as it is much closer to the immediate window than the "expressions view".
-
Bayard Randel almost 14 yearsThanks for that - I was missing the immediate window!
-
Doguhan Uluca about 13 yearsSelect the statement, right-click and then Execute. You can also press the little play button on the display toolbar.
-
Sushant Bhatnagar over 12 yearsanother option to open it Ctrl+Num 3 , then type expression
-
K.L. over 11 yearswhile the answer is correct, in some way, Todds answer is better, as he provied a more exact analogy for VS Immediate Window
-
nakhli about 11 yearsauto-completion doesn't seem to work in the expression window. it's not convenient for evaluating snippets while debugging.
-
jjb over 10 yearsNeat, I didn't know about Scrapbook Pages.
-
Setafire about 8 yearsDo function calls work in the display window? They don't seem to work for me, or maybe I am misunderstanding how they work. If I enter a function name and hit enter, it doesn't display the return value.
-
mhan0125 over 6 yearsExpression does not work exactly like immediate window in Visual Studio, Todd's answer is much better and should be taken as answer.
-
João Antunes over 6 yearsI think I should downvote this answer in favor of the next one about the Display window
-
pushStack over 4 yearsIn eclipse 2019-09 R, it is called Debug Shell