Actually Remote Debugging is completely about an option you can set when calling
java.
java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n
the address can be any port number that you want. IntelliJ's configuration for Remote Debugging is address=5005, whereas Eclipse is 8000, or 7000, or 5000 I forget which one.
Now it is all set up.
In
JBoss, I got to the run.bat file and modify it to set an environment variable called JAVA_OPTS and set it to include the "-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
Hope that helps.
Mark