You can remotely debug a java application by first starting it like below.
java -Xdebug -Xrunjdwp:transport=dt_socket,address=8888,server=y ....
Then, any decent IDE (such as Eclipse) with facility to remote debug a java application will be able to attach into the running process under the specified port (in this case, 8888).
- Run > debug configurations > remote java application
- Use standard (socket attach), specify the port
- Attach the project source code
- start debugging
Not a netbeans fan so I don’t know how to work netbeans to do remote debug, but I imagine similar facility should be available.