I am working with a large Java program that uses a command line shell to run integration tests. How do I attach eclipse to that process? Do I have to run the process and then attach it? It would be great to attach it to the shell process before I run it.
When you start your integration tests, add the following arguments to Java.
-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y
The suspend=y
will pause startup until you attach with the debugger. In Eclipse, go to Run => Debug Configurations. Create a new "Remote Java Application" configuration and specify localhost as the host and 8000 as the port.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With