The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

GUI does not pop up in child process before parent is killed

Hi!

I have an application that launches other java apllications, each of them its own JVM. Fo that I use ProcessBuilder. Fore each application to be launched, the Main application creates a thread like this:

In that code, filename is the name of a .bat file that executes java.exe (among other things).

If the application being launched does not have a GUI, then everything works as expected. However, if it has a GUI, then I can see that a java.exe process is created, but the GUI does not pop up. For the GUI to pop up I have to kill the Main application. The problem is that sometimes, if I killed the Main application, the lanched application also dies. I am getting crazy with this behavior, so I would appreciate any help.

Also, if after invoking pb.start() I do not get and print the output of the just created process, the process dies. Is that normal?