views:

37

answers:

1

I hava a Java process that spawns a new JVM using ProcessBuilder etc. While debugging this, is it possible to have Eclipse attach a debugger to the new sub-process? Even better, is there any plugin that will do this automatically when it notices the new child process?

I'm told (though haven't seen) that VisualAge used to be able to do this - it would notice when you tried to create a new JVM, and instead create a debug-mode one and attach to it. Nifty.

A: 

Provide the usual JVM flags to indicate that you want to debug the process (vendor dependant), with a specific port, and have an Eclipse debug launch configuration to use that port.

Newer Eclipses can do the reverse trick, where the debugger waits on the port for the new JVM to attach when ready. That might be what you are looking for?

Thorbjørn Ravn Andersen
That would certainly be a start. I was being lazy and hoping that the whole thing could be automated. Maybe that's wishful thinking.
Joe Kearney