I use ProcessBuilder to start a new process (child) form a java application (host). Something like this:
ProcessBuilder processBuilder = createProcess(commandLine);
processBuilder.directory(new File(baseDir));
processBuilder.redirectErrorStream(true);
Process process = null;
try {
process = processBuilder.start();
} catch (Exception e) {
e.printStackTrace();
}
I do see in the system monitor that the child process has been started but it's not functioning unless I stop the host application. More specifically the child proecess is a server and after starting it with a ProcessBuilder it's not responding to the requests if the host application still is running. Moreover, the port that server is using still is available. The server starts working immediately if I stop the host application. Is there anything that I missed or that's how ProcessBuilder suppose to work? Many thanks in advance.