Java - running a few basic methods

I have an eclipse project regrouping two applications, I want to run the second application on my own or from the first, which I managed to do by simply calling the main method. The problem is that when I start the second application from the first, when I close this second application, it also closes the first application. Can I avoid this behavior and save the first application?

Thank.

+3
source share
1 answer

The second application probably issues System.exitwhen closed. The only way to prevent this from dragging the calling application is to run it in a separate process (for example, via ProcessBuilder.startor Runtime.exec) or by catching and preventing it System.exitusing a special security manager.

+4
source

All Articles