我想使用java程序启动tomcat。使用java代码在windows中启动Tomcat
我已经在Linux中使用下面的代码
String command = "c:\program files\tomcat\bin\startup.sh";
Process child = Runtime.getRuntime().exec(command);
它工作正常启动。
我以前在窗户下面的代码
String command = "c:/program files/tomcat/bin/startup.bat";
Process child = Runtime.getRuntime().exec(command);
它不工作。
我想为Windows配置任何其他属性。
在此先感谢。
'在Linux中的c:\ program files',不工作?任何异常? – 2012-07-09 04:18:41
yes.could找不到指定的文件路径 – muthukumar 2012-07-09 04:25:11
'Process'对象有'getErrorStream()'方法,请尝试读取它说的内容。 – 2012-07-09 05:20:56