How to Fix IntelliJ Debugger Not Hitting Breakpoints
In this tutorial, you'll learn about How to Fix IntelliJ Debugger Not Hitting Breakpoints. We cover key concepts, practical examples, and best practices.
The Problem
Breakpoints are set but the debugger does not stop:
Breakpoint in com.example.MyClass:42
Not hitting during execution
Quick Fix
Step 1: Verify the debugger is attached
Run in debug mode (the bug icon), not run mode (the play icon).
Run > Debug 'Application'
Step 2: Check breakpoint status
Breakpoints should have a checkmark. A red circle with a line through it means the breakpoint is disabled.
- Toggle breakpoints with
Ctrl+F8(Windows/Linux) orCmd+F8(macOS). - View all breakpoints with
Ctrl+Shift+F8.
Step 3: Fix breakpoint conditions
Right-click the breakpoint and check:
- Condition: Remove any conditions that may not be evaluating to
true. - Pass count: Set to 0 or 1 if filtering is not needed.
- Suspending: Ensure it is set to "All" or "Thread".
Step 4: Add source mappings
If debugging a library or decompiled class:
File > Settings > Build, Execution, Deployment > Debugger > Stepping
Check "Do not step into the following classes" — remove any relevant exclusions.
Step 5: Restart and clear caches
Run > Stop (or Ctrl+F2)
Run > Debug 'Application' again
If still not hitting:
File > Invalidate Caches and Restart
Step 6: Check for JIT optimization
Disable JIT inlining for debugging:
Run > Edit Configurations > VM options
Add:
-XX:-Inline -Xint
Prevention
- Use the Debug button (bug icon), not the Run button.
- View all breakpoints with
Ctrl+Shift+F8to see which are disabled. - Always run a clean build before debugging.
Common Mistakes with debugger not hitting
- Forgetting
deriving (Show, Eq)on custom data types needed for debugging - Placing the wildcard pattern first in case expressions, making all subsequent patterns unreachable
- Using
headandtailinstead of pattern matching, causing runtime errors on empty lists
These mistakes appear frequently in real-world INTELLIJ code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.
Practice Exercise
Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.
This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.
FAQ
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro