How to execute some function in eclipse while debugging a java program? February 19, 2023 by Tarik Use the Display view, or a bit quicker: highlight the code you want to run and right-click/Execute or Ctrl+U.