可能就是这个问题,QMAIL进程不会结束,Process也不会结束。The Runtime.exec methods create a native process and return an instance of a subclass of Process that can be used to control the process and obtain information about it. The class Process provides methods for performing input from the process, performing output to the process, waiting for the process to complete, checking the exit status of the process, and destroying (killing) the process.
我面临的问题就是启动了持续运行的进程之后如何返回,自作聪明加了个“&”也没用
try
{
Runtime rt = Runtime.getRuntime();
rt.exec("/etc/rc.d/init.d/qmail start &");
out.println("进程正在启动:");
} catch (Throwable t)
{
t.printStackTrace();
}
请问老兄知道什么方法满足我的需求吗?