How to debug spring-boot application with IntelliJ IDEA community Edition?

后端 未结 9 2149
野性不改
野性不改 2021-01-29 23:43

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

9条回答
  •  -上瘾入骨i
    2021-01-30 00:01

    For me these steps work:

    1. Select menu Run -> Edit Configurations...
    2. Create new Remote Configuration. By default you don't need to change settings:
      -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005. But if you want for example to suspend JVM before you connects, you can change suspend=y. Or you can chage port etc.
    3. Copy command line depending your JVM version and save configuration.
    4. In Terminal window run your app with (in Maven usage case and JVM 1.5 and higher) mvn clean spring-boot:run -Drun.jvmArguments="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
    5. Connect to your app by running your Remote Configuration created prviously on step 2. Now you can debug your app.

提交回复
热议问题