What is the best way to find out the state of a java process running under debugger? I would like to know how many processes running. I also would like to be notified when a particular process is finished.