It's not possible with the debugger to not execute parts of the code.

It is however possible to execute extra code and change values on variables so if you need to exclude one row from execution during debug you will have to alter your code to prepare for that kind of debugging.

Copypublic void someMethod() {
    int a = 3;
    int b = 2;
    boolean shouldRun = true;
    if (shouldRun) {
        a = b + 2;
    }
    System.out.prinln(a);
}

You would then set a break point that changes the value of shouldRun without stopping execution. It can be done like this.

Note that

  1. Suspend isn't checked
  2. Log evaluated expression is used to alter a variable when the break point is hit
Answer from Andreas Wederbrand on Stack Overflow
🌐
JetBrains
blog.jetbrains.com › idea › 2020 › 05 › debugger-basics-in-intellij-idea
Debugger Basics for Java Code in IntelliJ IDEA | The IntelliJ IDEA Blog
July 26, 2024 - Step Into (F7) will take you to the first line of code in a method defined in the same class, or another class in the application. Force Step Into lets you debug methods defined in the APIs or libraries. If the source code of the API or library is not available, IntelliJ IDEA decompiles and debugs it for you. With Step Out, you can skip stepping through code in a method line by line and return to the calling method.
Discussions

intellij idea - how to set debug mode compile and run project one line by one line from the program entry - Stack Overflow
I get a large Intellij Idea project about java and scala and I want to read its code in debug mode. So I try to find the whole project entry by compiling and runing it one line by one line. But I o... More on stackoverflow.com
🌐 stackoverflow.com
IntelliJ Debugging Cheat Sheet
Good so far, there some things that are missing that I find very useful. Conditional breakpoints, logging at breakpoints, suspending thread options - just right click the breakpoint for options or in press CTRL-SHIFT-F8 for options. Seeing return values from method calls - settings (cog) in the debug panel. Don't set breakpoints on methods, this will most likely slow down your app to a crawl. This means not putting the breakpoint on the line a method is defined, Intellij will warn you anyway. In the debug panel in variables section - right click on any of them and explore the options. You can copy values, set values, watch variables and much more - it's cool. For example watches. This lets you define variables that will be evaluated everytime a method is suspended so you can put lots of stuff in there like list sizes, conditionals etc., whatever you find handy. Perhaps a section on remote debugging. More on reddit.com
🌐 r/learnjava
7
34
March 13, 2019
How to debug boolean method calls with IntelliJ
IntelliJ Debugger Tutorial vid More on reddit.com
🌐 r/javahelp
3
1
September 17, 2020
How to stepback while debugging?
Not in the current version, see my answer at https://stackoverflow.com/a/55911539/104891 . More on reddit.com
🌐 r/IntelliJIDEA
5
1
January 6, 2022
🌐
JetBrains
jetbrains.com › help › idea › stepping-through-the-program.html
Step through the program | IntelliJ IDEA Documentation
January 23, 2026 - If there are several method calls on the line, IntelliJ IDEA asks you which method to enter. This feature is called Smart step into. You can configure Smart Step Into to be automatically used every time when there are multiple method calls on the line. Alternatively, it can be invoked only when you expressly do so. To configure this feature, go to Settings | Build, Execution, Deployment | Debugger | Stepping and set the Always do smart step into option as required.
🌐
JetBrains
jetbrains.com › help › idea › debugging-your-first-java-application.html
Tutorial: Debug your first Java application | IntelliJ IDEA Documentation
February 10, 2026 - Click the Run button near the main method. From the menu, select Debug. The debugger session starts, executing the program with the given arguments. After the debugger session has started, the program runs normally until a breakpoint is hit.
🌐
Medium
medium.com › @AlexanderObregon › debugging-java-applications-with-intellij-idea-a-step-by-step-guide-5f6e98c1b295
Debugging Java Applications with IntelliJ IDEA — A Step-by-Step Guide
April 25, 2024 - To fix this, change the loop condition in line 10 from i <= numbers.length to i < numbers.length. After making this change, rerun the debugger to ensure that the bug has been fixed. Sometimes, you might want to pause the program execution only when a specific condition is met. In IntelliJ IDEA, ...
🌐
JetBrains
jetbrains.com › help › idea › debugging-code.html
Debug code | IntelliJ IDEA Documentation
3 weeks ago - This approach is covered in the Reload modified classes topic. If you are new to debugging, we recommend that you complete the Debugging Your First Java Application tutorial. If you are already familiar with IntelliJ IDEA debugger and want to get an overview of various useful features and approaches, take a look at Debugger Refresher video series. Debugger Essentials covers basic topics like line breakpoints, stepping, controlling the debug session, watches, expression evaluation, and breakpoint conditions.
🌐
Medium
tharakamd-12.medium.com › debug-like-a-pro-in-intellij-idea-6c3599117297
Debug Like a Pro in IntelliJ IDEA | by Dilan Tharaka | Medium
June 1, 2021 - Stream tracing is an interesting feature in the Intellij IDEA debugger. This feature allows us to debug the behavior of a Java Stream in a graphical way. To demonstrate this, I’m using the following sample code. This has a List of Strings and using stream processing to uppercase the list of words and get the count of words where length is greater than 3. ... If we place a debug point in the line having the stream procession part, and run the program.
Find elsewhere
🌐
TutorialsPoint
tutorialspoint.com › intellij_idea › intellij_idea_debugging.htm
Intellij Idea - Debugging
In the above code, allFunctions() calls 3 more functions. Let us set the breakpoint at this function. Follow these steps to perform smart step into − ... Select smart step into. Select the child function to go. During debugging, IntelliJ shows value of variable in the Editor window itself.
🌐
JetBrains
blog.jetbrains.com › idea › 2020 › 08 › jump-to-any-line-while-debugging
Jump to Any Line While Debugging | The IntelliJ IDEA Blog
January 24, 2023 - You can use breakpoints, or step to the line using the Step Over (F8), Step Into (F7), and Run to Cursor (⌥F9) commands. But what if you want to jump to a particular line and set an execution point there, without executing the preceding code?
🌐
Stack Overflow
stackoverflow.com › questions › 68449107 › how-to-set-debug-mode-compile-and-run-project-one-line-by-one-line-from-the-prog
intellij idea - how to set debug mode compile and run project one line by one line from the program entry - Stack Overflow
I get a large Intellij Idea project about java and scala and I want to read its code in debug mode. So I try to find the whole project entry by compiling and runing it one line by one line. But I only found the f7 and f8, which can compile and run it by per function and per line.
🌐
JetBrains
blog.jetbrains.com › idea › 2025 › 04 › debugging-java-code-in-intellij-idea
Debugging Java Code in IntelliJ IDEA | The IntelliJ IDEA Blog
August 12, 2025 - To see all parts of the current line, click the View link next to the `parts` variable in the Debug tool window. Here we see that “8.7’ is actually a test score, as you might have guessed.
🌐
Automationintesting
automationintesting.com › java › intellij › lessons › debugging.html
Debugging In IntelliJ | Automation in Testing
We then need to go to that line in the class, and click next to the line number, to the left of the code. It should add a red dot. This is a breakpoint. So now if we run our test in ‘debug’ mode, our code will stop at this point. You can run a test in debug mode by right clicking, and instead ...
🌐
Se-education
se-education.org › guides › tutorials › intellijDebugger.html
Intellij IDEA: Using the debugger - SE-EDU
How: Click on the left gutter of the editor pane, at the line where you want to breakpoint. A red dot will appear to indicate the breakpoint. ... To remove the breakpoint, click the red dot again. ... More info from Intellij Docs is here. Purpose: To get Intellij to run the code in the debugger mode, so that the debugger can direct the execution flow as needed by ...
🌐
Digma
digma.ai › 11-java-debugging-tips-techniques-using-intellij-ide
11 Java Debugging Tips & Techniques using IntelliJ IDE
May 1, 2024 - To set a field watchpoint on IntelliJ, you can place a caret on the line where the field is declared and press Ctrl + F8. Debugging large Java code bases can be overwhelming, even for an experienced developer.
🌐
JetBrains
jetbrains.com › guide › java › tutorials › reading-code › test-debug
Testing and debugging in IntelliJ IDEA.
March 1, 2024 - First, we need to place a breakpoint at the location in the code we’re interested in. Use ⌘F8 (macOS) / Ctrl+F8 (Windows/Linux) to toggle the breakpoint. Next, we run our test using the debug option.
🌐
JetBrains
jetbrains.com › help › idea › starting-the-debugger-session.html
Start the debugger session | IntelliJ IDEA Documentation
February 10, 2026 - If you already have a run/debug configuration, select it in the run widget, then click Debug or press Shift+F9. To launch a debug session for an existing run/debug configuration from the editor, press Alt+Shift+F9 and select it from the menu.
🌐
DZone
dzone.com › testing, deployment, and maintenance › testing, tools, and frameworks › how to debug java with intellij: breakpoints, evaluate expression, watches, and variable view
How to Debug Java with IntelliJ: Breakpoints, Evaluate Expression, Watches, and Variable View
July 25, 2016 - it will be fairly obvious to most people what is going on, but if i put a breakpoint on the line that is failing then i can debug the @test method and step through the code to see what is going on.
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 13217450658322-Debugging-method-return-value-in-a-single-step
Debugging method return value in a single step – IDEs Support (IntelliJ Platform) | JetBrains
I tried setting the breakpoint in the closing line of method (Line 8 in the first screenshot) but the debugger won't stop there to show the value. You can follow the guide here: https://stackoverflow.com/questions/5010362/can-i-find-out-the-return-value-before-returning-while-debugging-in-intellij