public static void main(String[] args) throws IOException { Runtime runtime = Runtime.getRuntime(); Process process = runtime.exec("D:/tool/server/apache-tomcat-7.0.52-windows-x64/apache-tomcat-7.0.52/bin/startup.bat",null,new File("D:/tool/server/apache-tomcat-7.0.52-windows-x64/apache-tomcat-7.0.52/bin")); // Process process = runtime.exec("startup.bat"); runtime.gc(); BufferedReader input = new BufferedReader(new InputStreamReader(process.getInputStream())); String line = null, result = ""; while ((line = input.readLine()) != null) result += line + "\r\n"; input.close(); System.out.println(result); }
tomcat用java启动
最新推荐文章于 2024-01-03 17:01:48 发布