Paul Clapham wrote:This code will cause your application to terminate:
When I add that after the "Runtime.exec" it doesn't exit my app. It waits for the notepad window to close. I have also tried creating a new
thread before opening notepad and it doesn't help either. The second thread finishes but the java program continues to run until the notepad window is closed.
The result of runnign the code is:
The program then continues to run until the notepad window is closed. After that the java program exits without printing the "stop" line, which is to be expected.