What are Java command line options to set to allow JVM to be remotely debugged?

后端 未结 8 2581
猫巷女王i
猫巷女王i 2020-11-22 06:37

I know there\'s some JAVA_OPTS to set to remotely debug a Java program.

What are they and what do they mean ?

相关标签:
8条回答
  • 2020-11-22 07:08

    Here is the easiest solution.

    There are a lot of environment special configurations needed if you are using Maven. So, if you start your program from maven, just run the mvnDebug command instead of mvn, it will take care of starting your app with remote debugging configurated. Now you can just attach a debugger on port 8000.

    It'll take care of all the environment problems for you.

    0 讨论(0)
  • 2020-11-22 07:10

    Command Line

    -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=PORT_NUMBER
    

    Gradle

    gradle bootrun --debug-jvm
    

    Maven

    mvn spring-boot:run -Drun.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=PORT_NUMBER
    
    0 讨论(0)
提交回复
热议问题