public class Test {
public static void main(String[] args) {
new Test().startTomcat();
}
public void startTomcat() {
try {
Runtime r = Runtime.getRuntime();
//结束tomcat 进程 taskkill /F /IM tomcat6.exe
//开启一个tomcat程序
Process p = r.exec("D:\\Program Files\\Apache Software Foundation\\Tomcat 6.0\\bin\\tomcat6.exe");
DataInputStream i = (DataInputStream) p.getInputStream();
while (i.readLine() != null) {
i.read();
}
} catch (Exception e) {
}
}
public static void main(String[] args) {
new Test().startTomcat();
}
public void startTomcat() {
try {
Runtime r = Runtime.getRuntime();
//结束tomcat 进程 taskkill /F /IM tomcat6.exe
//开启一个tomcat程序
Process p = r.exec("D:\\Program Files\\Apache Software Foundation\\Tomcat 6.0\\bin\\tomcat6.exe");
DataInputStream i = (DataInputStream) p.getInputStream();
while (i.readLine() != null) {
i.read();
}
} catch (Exception e) {
}
}