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
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:
localhost
/5005
are fine