Your question is missing some information that illustrates the problem or constraint, since what you ask can be done. The following 1-line program, when executed in Windows using java xx, initiates Notepad and then exits, leaving Notepad running and the cmd window available for further use
Runtime.getRuntime().exec("Notepad.exe");.
Your code works fine in case of normal termination. But in my case, my Swing Application is killed forcefully by a windows process where it enumerates all the child processes and kills them also. Here i want my child applicaion to exist even after parent(Swing applcation) gets killed forcefully.