Debugging my code in IntelliJ

后端 未结 1 399
攒了一身酷
攒了一身酷 2021-01-13 09:11

I am using JBoss with IntelliJ. I am running Jboss outside intellij. i.e running in Command Prompt. If that is the case, Can I debug my code in IntelliJ

相关标签:
1条回答
  • 2021-01-13 09:39

    You can debug any running JVM, even remote on a different computer via JDWP. First you need to prepare JBoss (same thing applies to any JVM) to listen for debugger connections on a given TCP/IP port:

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

    This set of parameters has to be added to Java options, look for JAVA_OPTS variable in your JBoss startup scripts. Once this is done, JBoss will listen on 5005 port for debugger connection. The very first line in JBoss console after starting it up should be:

    Listening for transport dt_socket at address: 5005
    

    Now you can attach your IntelliJ by choosing:

    1. Run
    2. Edit configurations
    3. "+" (Add)
    4. Remote
    5. localhost/5005 are fine
    0 讨论(0)
提交回复
热议问题