Skip to content

Instantly share code, notes, and snippets.

@GiuseppeMP
Last active July 21, 2023 22:50
Show Gist options
  • Save GiuseppeMP/64bbaab2ddcedb6f85a0bb900d63e462 to your computer and use it in GitHub Desktop.
Save GiuseppeMP/64bbaab2ddcedb6f85a0bb900d63e462 to your computer and use it in GitHub Desktop.
Recipes - Debbuging jvm

options

suspend = y, if you want that application waits the debbuger to start.

address = 5005 or number, the remote debugger port.

java -jar:

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

Maven:

mvn .. -Drun.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"

Mvn spring-boot:run

mvn spring-boot:run -Dspring-boot.run.jvmArguments="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000"

Gradle:

gradle .. --debug-jvm
bootRun {
   systemProperties = System.properties
}

gradle bootRun -Dagentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment