2016-09-17 47 views

回答

0

以下代碼片段啓動「firefox」web瀏覽器。exec()的參數是您想要從java代碼中觸發的shell命令。

import java.io.IOException; 

public class App { 

    public static void main(String[] args) throws IOException { 
     Runtime runtime=Runtime.getRuntime(); 
     Process p=runtime.exec("firefox"); 
    } 
} 
相關問題