读书人

Runtime.getRuntime().exec();如何写

发布时间: 2012-01-30 21:15:58 作者: rapoo

Runtime.getRuntime().exec();怎么写
在java里调用cmd执行下面两句启动openOffice服务:

cd C:\Program Files\OpenOffice.org 3\program

soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard

用Runtime.getRuntime().exec();怎么用怎么写?



[解决办法]
一次只能执行一个命令,最好把你想要实现的东西做成bat文件。java里只执行bat就完了
[解决办法]

Java code
Process soffice = new ProcessBuilder("soffice","-headless","-accept='socket,host=127.0.0.1,port=8100;urp;'","-nofirststartwizard").start();............soffice.destory(); 

读书人网 >Java相关

热点推荐