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?

Share:
23,865
Justin R.
Author by

Justin R.

My new indention style is unstoppable.

Updated on July 12, 2020

Comments

  • Justin R.
    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.
    Justin R. almost 15 years
    Expressions are pretty close. Thanks!
  • Rich Seller
    Rich Seller almost 15 years
    To 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
    Michal almost 15 years
    i would recommend updating this as the correct answer as it is much closer to the immediate window than the "expressions view".
  • Bayard Randel
    Bayard Randel almost 14 years
    Thanks for that - I was missing the immediate window!
  • Doguhan Uluca
    Doguhan Uluca about 13 years
    Select the statement, right-click and then Execute. You can also press the little play button on the display toolbar.
  • Sushant Bhatnagar
    Sushant Bhatnagar over 12 years
    another option to open it Ctrl+Num 3 , then type expression
  • K.L.
    K.L. over 11 years
    while the answer is correct, in some way, Todds answer is better, as he provied a more exact analogy for VS Immediate Window
  • nakhli
    nakhli about 11 years
    auto-completion doesn't seem to work in the expression window. it's not convenient for evaluating snippets while debugging.
  • jjb
    jjb over 10 years
    Neat, I didn't know about Scrapbook Pages.
  • Setafire
    Setafire about 8 years
    Do 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
    mhan0125 over 6 years
    Expression 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
    João Antunes over 6 years
    I think I should downvote this answer in favor of the next one about the Display window
  • pushStack
    pushStack over 4 years
    In eclipse 2019-09 R, it is called Debug Shell