← All articles
Tools1 min read

Debugging Java in IntelliJ IDEA

IntelliJ's debugger goes far beyond breakpoints — evaluate expressions, drop frames, and change values live. Here's how to use it well.

S

Swapnika Voora

Author

IntelliJ ships one of the most capable JVM debuggers available. Beyond pausing on a line, it lets you evaluate arbitrary code, alter execution, and inspect the heap — all without restarting your program.

Conditional and dependent breakpoints

Right-click a breakpoint to add a condition so it only triggers when it matters.

Example.java
for (Order order : orders) {
    process(order);   // breakpoint condition: order.getTotal() > 1000
}

Only orders over 1000 will pause execution — no more stepping through hundreds of irrelevant iterations.

Evaluate expressions live

Alt + F8 opens Evaluate Expression, where you can run any code in the paused context — call methods, inspect collections, even mutate state.

debugger actions
F8                Step over
F7                Step into
Shift + F8        Step out
Alt + F8          Evaluate expression
Ctrl/Cmd + Alt + R  Resume program

Drop frames to retry

The Drop Frame action pops the current stack frame so you can re-enter a method without restarting — invaluable when you step one line too far.

Watch and inspect

Add fields to Watches to track them across steps, and hover any variable to expand its full object graph inline.

Takeaways

  • Conditional breakpoints skip straight to the case you care about.
  • Evaluate Expression runs arbitrary code in the paused frame.
  • Drop Frame lets you replay a method without restarting the app.

Enable "Show method return values" in debugger settings to see what each call returned as you step — often the fastest way to find a wrong result.

#intellij#java#debugging

More in Tools