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 c开发者_JS百科reate a new JVM, and instead create a debug-mode one and attach to it. Nifty.
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?
精彩评论