Master IntelliJ IDEA Debugging: Essential Tips, Shortcuts, and Advanced Techniques

This comprehensive guide explains how to use IntelliJ IDEA's Debug mode, covering the UI layout, essential shortcuts, variable inspection, expression evaluation, smart step‑into, breakpoint conditions, exception breakpoints, multithread debugging, frame dropping, and force return to streamline Java backend development.

Java Backend Technology
Java Backend Technology
Java Backend Technology
Master IntelliJ IDEA Debugging: Essential Tips, Shortcuts, and Advanced Techniques

Introduction

Debugging tracks code execution, helps locate exceptions, and allows you to explore third‑party framework source code. This guide shows how to use IntelliJ IDEA’s Debug mode effectively.

Debug UI Overview

When you start a Debug session, IDEA displays eight key areas:

Run/Debug toggle button (left side)

Breakpoint gutter (click or Ctrl+F8 to toggle)

Debug window (auto‑activates at the first breakpoint)

Debug control buttons (8 buttons for stepping, resuming, etc.)

Service button (start/stop service, manage breakpoints)

Call stack (shows all method calls; hide third‑party frames with Show All Frames)

Variables pane (shows variables in the current method)

Watches pane (drag variables here for persistent monitoring)

Basic Usage & Shortcuts

The most common debugging actions are mapped to the following shortcuts:

Show Execution Point (Alt+F10): jump to the current execution line.

Step Over (F8): move to the next line without entering called methods.

Step Into (F7): enter the method on the current line.

Force Step Into (Alt+Shift+F7): enter any method, even library code.

Step Out (Shift+F8): exit the current method and return to the caller.

Drop Frame : revert to the previous stack frame.

Run to Cursor (Alt+F9): execute until the cursor line.

Evaluate Expression (Alt+F8): calculate an expression on the fly.

Variable Inspection

You can view variable values in several places:

Inline hints next to parameters.

Hover over a variable to see its current value.

Variables pane shows all locals in the current method.

Watches pane lets you add custom watches or drag variables from the Variables pane.

Evaluate Expression

Press Alt+F8 (or click the button) to open the Evaluate Expression window, where you can type any expression, including method calls, and see its result without adding print statements. You can also modify variable values directly in this window.

Smart Step Into

When a line contains multiple method calls, use Smart Step Into (Shift+F7) to choose which method to enter. IDEA lists the candidate methods; selecting one jumps directly into it.

Breakpoint Conditions & Filters

You can add conditions to a breakpoint so it only stops when the expression is true. Right‑click a breakpoint to set the condition, or open View Breakpoints (Ctrl+Shift+F8) to manage all breakpoints, enable logging, or evaluate expressions on hit. Filters such as instance and class filters, as well as pass count, help limit when breakpoints trigger.

Exception Breakpoints

Add Java Exception Breakpoints (e.g., NullPointerException) to pause execution automatically when the specified exception is thrown.

Multithread Debugging

IDEA blocks other threads by default (ALL). Change the thread blocking level in View Breakpoints to allow other threads to run, and switch threads via the Frames dropdown.

Drop Frame & Force Return

Use the Drop Frame button or right‑click a stack frame to revert to a previous method call. After dropping, press Resume (F9) to continue. To abort the current request, use Force Return (Alt+Shift+F9) and provide a return value, e.g., an empty HashMap<>().

Conclusion

By mastering IDEA’s Debug UI, shortcuts, variable inspection, expression evaluation, smart stepping, conditional breakpoints, exception handling, multithread control, and frame manipulation, you can diagnose issues faster and gain deeper insight into Java backend applications.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

JavaIntelliJ IDEADebug Shortcuts
Java Backend Technology
Written by

Java Backend Technology

Focus on Java-related technologies: SSM, Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading. Occasionally cover DevOps tools like Jenkins, Nexus, Docker, and ELK. Also share technical insights from time to time, committed to Java full-stack development!

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.