当Java需要调用windows系统进行交互时,可以使用Runtime进行操作. 例子: 1.调用window中获取关于java相关的进行信息 Runtime rt = Runtime.getRuntime(); Process p = rt.exec("wmic process where caption=\"javaw.exe\" get caption,commandline /value"); BufferedReader br = new Buffered
当我们需要在java程序中调用外部程序,我们可用通过Runtime.exec()调用来完成. The class java.lang.Runtime features a static method called getRuntime(), which retrieves the current Java Runtime Environment. That is the only way to obtain a reference to the Runtime object. With that