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

前端 未结 10 1903
耶瑟儿~
耶瑟儿~ 2021-01-30 04:01

Like firebug for debugging javascript,

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

相关标签:
10条回答
  • 2021-01-30 04:19

    I believe that what you're looking for are "watch expressions". Just mark the piece of code in the source code view, right-click and select "Watch".

    0 讨论(0)
  • 2021-01-30 04:21

    you can use the 'Display' view to evaluate expressions in eclipse.

    Look under the debug list of views. It is a standard par part of the java tooling so you don't need a plugin

    0 讨论(0)
  • 2021-01-30 04:26

    Complementing all the amazing answers, for mac users is cmd + D

    0 讨论(0)
  • 2021-01-30 04:26

    Like others say, you use the Display view. But for some variants of Eclipse, it may be named differently. For instance, if you are using Spring Tool Suite as your Eclipse, the View name corresponding to Display view is Debug Shell.

    0 讨论(0)
  • 2021-01-30 04:27

    I'm currently using Eclipse Photon (v4.8.0). Eclipse changed the "Display" View name to "Debug Shell View". Here, you can execute commands on-the-fly.

    0 讨论(0)
  • 2021-01-30 04:30

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

    0 讨论(0)
提交回复
热议问题