Java does not provide an automated way to debug processes and their child processes. To enable debugging, you must start the child process using the JVM options. IDEA configuration Remote debugging will suggest the right use cases. After starting the process using the appropriate parameters, you can connect to it using IDEA with the Remote Debugging configuration.
Examples of parameters:
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
You can start with suspend=y to pause execution until you connect to the debugger.
source share