🌐
JetBrains
jetbrains.com › help › idea › debugging-your-first-java-application.html
Tutorial: Debug your first Java application | IntelliJ IDEA Documentation
February 10, 2026 - Enter 1 2 3 in the Program arguments field. Apply changes and close the dialog. Click the Run button near the main method. From the menu, select Debug. The debugger session starts, executing the program with the given arguments.
🌐
JetBrains
jetbrains.com › help › idea › debugging-code.html
Debug code | IntelliJ IDEA Documentation
4 days ago - IntelliJ IDEA provides a debugger for Java code. Depending on the installed/enabled plugins, you can also debug code written in other languages. During a debugging session, you launch your program with the debugger attached to it. The purpose of the debugger is to interfere with the program ...
Discussions

java - How to debug spring-boot application with IntelliJ IDEA community Edition? - Stack Overflow
Bring the best of human thought and AI automation together at your work. Explore Stack Internal ... I'm having difficulties in debugging a Java spring-boot application on IntelliJ IDEA community Edition. The main problem is, that the IDE won't stop on a breakpoint, even the program surely executes ... More on stackoverflow.com
🌐 stackoverflow.com
debugging - Attach IntelliJ IDEA debugger to a running Java process - Stack Overflow
This is helpful if the breakpoint you want to hit occurs on application startup. Start your application as you would normally, then in IntelliJ select the new configuration and hit 'Debug'. More on stackoverflow.com
🌐 stackoverflow.com
What are non trivial functionalities of IntelliJ IDEA you are using ?
Some less-obvious features: Breakpoints can log stuff rather than stop execution. Think about debugging with logs, but without changing code. You can set breakpoint on field change. Helps when something changes value and you want to understand what does that. HTTP client can save data from previous requests. E.g. call auth endpoint, save token and use that token for following requests. ### Authentication/SignInExternalApp POST {{base_url}}/api/Authentication/SignInExternalApp Content-Type: application/json {"systemUsername": "{{username}}", "systemPassword": "{{password}}"} > {% client.global.set("token", response.body.toString()); %} ### Dictionary/GetPosts POST {{base_url}}/api/Dictionary/GetPosts Authorization: Bearer {{token}} Content-Type: application/json { "orgHealthCareID": "57000000000004122" } 4. Postgres database connection can be marked as readonly and with manual transactions. For extra safety when dealing with production databases. 5. Settings/Editor/Live Templates. Very powerful feature. E.g. you can set it up, so you type slf and it expands it to private static final Logger logger = LogFactory.getLogger(CurrentClass.class); with proper imports. 6. Disable plugins you don't need. Helps with startup time. My Idea starts 2 seconds from icon click and to start screen. And then another 3 seconds to open project. Also sometimes removes UI elements, e.g. Golang plugin likes to add his menu items to Java projects. 7. Do not update on next major version before two patch releases are released. Helps to keep sanity. 8. "Postfix" programming. "Hello world".var String msg = "Hello world"; msg.eq msg.equals("world").if if (msg.equals("world")) { /// } Really helps with typing code, but requires some time to adapt. More on reddit.com
🌐 r/java
106
177
August 18, 2022
Debugging

If you're building and running locally then it should be easy enough to run your project in debug. Just set some obvious breakpoints and see if it catches after starting with the debug icon. If not then google is your friend.

Intellij likes to do things automagically which can be good and bad. If you set up your project properly then debugging should be trivial.

If you are deploying after building then you may need to set up remote debugging.

Otherwise. Set break points. Step through code. 'Step over' methods is very helpful for code that isn't yours, 'step into' methods if you want to see that method stepped through as well. Set watch variables if needed.

Your question is kind of vague so I hope that helps.

More on reddit.com
🌐 r/IntelliJIDEA
3
12
November 17, 2020
🌐
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.
🌐
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.
🌐
JetBrains
jetbrains.com › help › idea › tutorial-remote-debug.html
Tutorial: Remote debug | IntelliJ IDEA Documentation
March 31, 2026 - Once the remote app is up and listening, you use your local machine to start a debugger in “attach” mode. This connects the IntelliJ IDEA's debugger to the remote application over the network, allowing you to debug it.
🌐
TutorialsPoint
tutorialspoint.com › intellij_idea › intellij_idea_debugging.htm
Intellij Idea - Debugging
Navigate to the Run menu. Select the Debug option. While debugging, if a function is encountered and a step into action is selected, then debugger will stop program execution at each point of that function as if debugging is enabled for that ...
🌐
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 do this, click on “Run” > “Evaluate Expression” or press “Alt + F8” while the program is paused. Enter the expression you want to evaluate, and click “Evaluate” to see the result.
🌐
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 - In this blog post, we will look at how to debug Java code using the IntelliJ IDEA debugger. We will look at how to fix a failing test, how to find out where an `Exception` is thrown, and how to find p
Find elsewhere
🌐
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.
🌐
Automationintesting
automationintesting.com › java › intellij › lessons › debugging.html
Debugging In IntelliJ | Automation in Testing
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 of ‘Run ... '. Your test will start like normal, but as soon as it hits your breakpoint, IntelliJ ...
🌐
JetBrains
jetbrains.com › guide › java › tutorials › reading-code › test-debug
Testing and debugging in IntelliJ IDEA.
March 1, 2024 - Use ⌘F8 (macOS) / Ctrl+F8 (Windows/Linux) to toggle the breakpoint. Next, we run our test using the debug option. We can do so by clicking the green run button in the gutter next to our test.
🌐
JetBrains
jetbrains.com › help › idea › debug-tool-window.html
Debug tool window | IntelliJ IDEA Documentation
3 weeks ago - Overhead: lets you monitor the resources consumed by particular debugger features and optimize the debugger performance. To cycle through the tool window tabs, press Alt+Right and Alt+Left.
🌐
Baeldung
baeldung.com › home › ide › intellij debugging tricks
IntelliJ Debugging Tricks | Baeldung
February 2, 2026 - It’s bound to the Shift + F7 by default and looks like this when invoked: Now we can choose the target method to proceed by using arrow keys or by pressing Tab. Also, note that IntelliJ always puts the outermost method to the top of the list.
🌐
Se-education
se-education.org › guides › tutorials › intellijDebugger.html
Intellij IDEA: Using the debugger - SE-EDU
How: There are several ways. One of them is to click the icon in the gutter near the class with the main() method and select Debug. ... More info from Intellij Docs is here.
🌐
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.
Top answer
1 of 13
213

EDIT: it does not work anymore from Spring Boot 3+. See Ruik's comment


tldr: You can try tweaking the command line like this:

spring-boot:run -Dspring-boot.run.fork=false

Explanation:

When running the application in debug mode, the IntelliJ debugger attaches to the Java process that it starts itself (by appending the appropriate parameters, -agentlib:jdwp etc, to the Java command line).

Quite often, these Java processes might then fork a new instance, which is not getting the same parameters, and because it is in a separate process, is not connected to the debugger. This can be confusing.

The spring-boot:run Maven goal, in addition to forking a new JVM, creates even more confusion, because it sometimes does fork and sometimes doesn't, depending on the options it gets, among other things. Some of this can be found in the documentation, but it's not always obvious.

You should first check whether the Java process actually is being debugged at all. When you start the application from IntelliJ, you will see messages scrolling by in the Run / Debug tab. At the top, there's the command line that is being executed. It should contain the debugger parameters (-agentlib:jdwp etc) and it should be followed by a message saying "Connected to the target VM", which is the debugger confirming that it has contact.

Next, if you are unsure if the JVM has been forked, you can check the process list in your OS, for example under MacOS and *nix you can use ps aux | grep java. The Java processes typically have a giant parameter list, most of which is the class path. The actual application being run is at the very end of the command line. If the JVM was forked, you have the process running the Maven goal, and another one running the Spring application. Then your debugger will be connected to the process you are not interested in, and your breakpoints won't work.

To stop spring-boot:run from forking, you can use the fork parameter above.

2 of 13
109

The only approach that worked for me, is running or debugging application directly from Intellij Idea. Just open class which contains

 public static void main(String[] args) {
        SpringApplication.run(MyApp.class, args);
    }

And click right mouse button->Debug my application

🌐
JetBrains
jetbrains.com › help › idea › run-debug-gradle.html
Run/Debug Configuration: Gradle | IntelliJ IDEA Documentation
April 10, 2025 - Debug Gradle scripts - enables breakpoints in the Gradle scripts. This option is disabled when you execute your test using left gutter in the editor or the context menu. This is done to speed up your debugging process.
🌐
JetBrains
jetbrains.com › help › idea › spring-debugger.html
Spring debugger | IntelliJ IDEA Documentation
3 weeks ago - Run a Spring application in debug mode. Open the Database tool window. Click the Refresh button. In the discovered databases, you can view the tables, directly execute SQL queries, explore the schema, and so on, similar to how you would with any other data source. For more information on working with databases from IntelliJ IDEA, see the Database Tools and SQL section.
Top answer
1 of 5
414

Yes! Here is how you set it up.

Run Configuration

Create a Remote run configuration:

  1. Run -> Edit Configurations...
  2. Click the "+" in the upper left
  3. Select the "Remote" option in the left-most pane
  4. Choose a name (I named mine "remote-debugging")
  5. Click "OK" to save:

JVM Options

The configuration above provides three read-only fields. These are options that tell the JVM to open up port 5005 for remote debugging when running your application. Add the appropriate one to the JVM options of the application you are debugging. One way you might do this would be like so:

export JAVA_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"

But it depends on how your run your application. If you're not sure which of the three applies to you, start with the first and go down the list until you find the one that works.

You can change suspend=n to suspend=y to force your application to wait until you connect with IntelliJ before it starts up. This is helpful if the breakpoint you want to hit occurs on application startup.

Debug

Start your application as you would normally, then in IntelliJ select the new configuration and hit 'Debug'.

IntelliJ will connect to the JVM and initiate remote debugging.

You can now debug the application by adding breakpoints to your code where desired. The output of the application will still appear wherever it did before, but your breakpoints will hit in IntelliJ.

2 of 5
50

It's possible, but you have to add some JVM flags when you start your application.

You have to add remote debug configuration: Edit configuration -> Remote.

Then you'lll find in displayed dialog window parametrs that you have to add to program execution, like:

-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005

Then when your application is launched you can attach your debugger. If you want your application to wait until debugger is connected just change suspend flag to y (suspend=y)

🌐
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 - Console log 🤔 , Nope, since we have the debugger, we can simply place a debug point 😎. But, wait, if that loop iterates thousands of times, the program would stop at the breakpoint thousands of times and you have to observe the value and continue. That is a real pain 😐 Console log then, isn’t is 🙃. Nope, we have this cool feature in the IntelliJ IDEA debugger called non-suspending breakpoints which is really useful in this type of scenario.