How to execute some function in eclipse while debugging a java program?

Like firebug for debugging javascript,

is there such a feature in eclipse? or do I need a plugin?


Use the Display view, or a bit quicker: highlight the code you want to run and right-click/Execute or Ctrl+U.


You can use the Display view to execute commands while debugging. You can find this in Window -> Show View -> Display


Select the line and press ctrl+shift+D or ctrl+shift+I This will give the result in a popup.


Use the debug shell! Coming from node, I was pretty used to being able to mess with my env variables at any time using node --inspect in chrome, and so it was imperative for me to find the same experience in eclipse without having to use JDB.

To open the debug shell, go to Window → Show View → Debug Shell

After you write the code you wish to run, simply highlight it, right click, and execute (⌘U also works)

Using the debug shell