Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging my code in IntelliJ

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

like image 408
user729344 Avatar asked May 12 '11 06:05

user729344


1 Answers

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
like image 179
Tomasz Nurkiewicz Avatar answered Oct 14 '22 16:10

Tomasz Nurkiewicz