For this, add the following options to the JVM args for remote debugging:
java -Xdebug -Xrunjdwp:transport=dt_socket,address=8998,server=y,suspend=n
And then just start IDE's remote debugger to listening on port 8998
transport=dt_socket tells that the debugger connections will be made through a socket while the address=8998 parameter informs it that the port number will be 8998. For suspend=y , the JVM starts in suspended mode and stays suspended until a debugger is attached to it.
Configuring Eclipse to Debug a Remotely Running Application
- Start Eclipse
- Navigate to Run -> Debug Configurations
- Create a new Remote Java Application configuration
- Configure the remote application's details
- click Apply
JPDA
Debugging J2EE Applications
Debugging with the Eclipse Platform
Nice article ,Remote Debugging is very useful for troubleshooting production issues on larget enterprise application, specially
ReplyDeleteif your applicaiton is live and you don't have proper development environment setup in your dev box.
Thanks
Javin
java remote debugging in Eclipse