Comprehensive Guide to Using Debug in IntelliJ IDEA
This article provides a detailed tutorial on leveraging IntelliJ IDEA's Debug mode, covering UI components, basic shortcuts, variable inspection, expression evaluation, smart step‑into, breakpoint conditions, multithreaded debugging, frame dropping, interrupting execution, and JRebel activation for efficient Java development.
The article introduces the importance of using Debug in IntelliJ IDEA to trace code execution, locate exceptions, and explore third‑party framework source code.
It outlines the tutorial contents: Debug overview, basic usage & shortcuts, variable viewing, expression evaluation, smart step‑into, breakpoint condition settings, multithreaded debugging, drop‑frame, interrupting Debug, and JRebel activation.
1. Debug Overview
Shows the Debug UI in IDEA, describing the start button (Run vs Debug), how to set breakpoints with Ctrl+F8, the automatic activation of the Debug window, the eight debug control buttons, the service button, method call stack (with Show All Frames option), Variables view, and Watches.
[Image 1.1]
[Image 1.2] Enable "Show debug window on breakpoint" in settings.
[Image 1.3] Show the bottom toolbar via View menu.
[Image 1.4] Debug functions in the Run menu with shortcut hints.
2. Basic Usage & Shortcuts
The main debug buttons are divided into two groups. Group 1 (8 buttons) includes Show Execution Point (Alt+F10), Step Over (F8), Step Into (F7), Force Step Into (Alt+Shift+F7), Step Out (Shift+F8), Drop Frame (default none), Run to Cursor (Alt+F9), and Evaluate Expression (Alt+F8).
Group 2 (7 buttons) includes Rerun, Update Application (Ctrl+F5), Resume Program (F9), Pause Program, Stop (Ctrl+F2), View Breakpoints (Ctrl+Shift+F8), and Mute Breakpoints.
[Image 2.1] Debug button layout.
Show Execution Point (Alt+F10): jumps to the current execution line.
Other shortcuts are described inline, such as Step Over, Step Into, Force Step Into, Step Out, Drop Frame, Run to Cursor, and Evaluate Expression.
3. Variable Inspection
Four ways to view variables during debugging:
Inline value display after the parameter.
Hover over a variable to see its value and click for details.
Variables pane shows all variables in the current method.
Watches pane allows adding custom watches or dragging variables from the Variables pane.
[Image 3.1] Inline variable values.
[Image 3.2] Hover details.
[Image 3.3] Detailed view after clicking.
[Image 3.4] Variables pane.
[Image 3.5] Adding a new watch.
4. Evaluating Expressions
The Evaluate Expression (Alt+F8) dialog lets you compute any expression or method return value without adding print statements. You can also modify variable values directly in this window.
[Image 4.1] Open the dialog.
[Image 4.2] Example of evaluating an expression.
[Image 4.3] Changing a variable's value in the dialog.
5. Smart Step‑Into
When a line contains multiple method calls, Smart Step Into (Shift+F7) lets you choose which method to enter, avoiding unnecessary navigation through other calls.
[Image 5.1] Smart Step Into button.
[Image 5.2] List of candidate methods after invoking Smart Step Into.
6. Breakpoint Conditions
You can set conditions so a breakpoint only stops when a specific expression evaluates to true, reducing unnecessary stops during large loops.
[Image 6.1] Setting a condition directly on a breakpoint.
View Breakpoints (Ctrl+Shift+F8) shows all breakpoints where you can enable Condition, Log Message, or Evaluate and Log.
[Image 6.2] Breakpoint properties panel.
[Image 6.3] Log Message to console.
Additional filters include Instance filters, Class filters, and Pass count for loop breakpoints.
[Image 6.4] Filters UI.
7. Multithreaded Debugging
By default IDEA blocks all threads (ALL) during debugging. Changing the Thread option in View Breakpoints to "Make Default" allows other threads to run.
[Image 7.1] Thread option in breakpoint settings.
[Image 7.2] Switching threads via the Frames dropdown.
8. Drop Frame (Rollback Breakpoint)
Drop Frame lets you revert the call stack to a previous method, either by using the Drop Frame button or right‑clicking a stack frame and selecting Drop Frame.
[Image 8.1] Call stack example.
[Image 8.2] Drop Frame button.
Note that state changes (e.g., modified objects, database updates) are not reverted.
9. Interrupting Debug (Force Return)
When you want to stop further processing, use Force Return to return a value immediately, bypassing the remaining code.
[Image 9.1] Force Return dialog.
10. Appendix: JRebel Activation
The author shares a method to obtain a free permanent JRebel activation code (non‑cracked) by logging into https://my.jrebel.com/ with a Facebook or Twitter account, retrieving the code, and entering it in the IDE's JRebel plugin settings.
Login to the JRebel website.
Navigate to Install and Activate to get the activation code.
Install the JRebel plugin in IDEA if not present.
Enter the activation code in the plugin settings.
[Image 10.1‑10.3] JRebel activation steps.
The article concludes with a call to share the content and join the architecture community.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java Architect Essentials
Committed to sharing quality articles and tutorials to help Java programmers progress from junior to mid-level to senior architect. We curate high-quality learning resources, interview questions, videos, and projects from across the internet to help you systematically improve your Java architecture skills. Follow and reply '1024' to get Java programming resources. Learn together, grow together.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
