2015-10-31 56 views
0

我試圖通過Java啓動英雄聯盟應用程序,但它的工作原理是爲了讓它獲得英雄聯盟加載徽標,我需要關閉父應用程序,啓動通過一個過程在Java的應用程序,但不關閉父應用程序?

這裏是運行它:

File dir = new File("C:/Riot Games/League of Legends/RADS/solutions/lol_game_client_sln/releases/0.0.1.110/deploy/"); 
        String[] cmd = new String[] { 
           dir.getAbsolutePath() + File.separator + "League of Legends.exe", 
           "8394", 
           "LoLLauncher.exe", 
           "\"\"", 
           "spectator spectator.na.lol.riotgames.com:80 " + currentGame.getObservers().getEncryptionKey() + " " + currentGame.getGameId() + " NA1"}; 
        try { 
         Runtime.getRuntime().exec(cmd, null, dir); 
        } catch (IOException e) { 
         e.printStackTrace(); 
        } 

它只是說,沒有響應,如果父應用程序仍處於打開狀態,之後我關閉父應用程序,它開始加載和作品。

回答

0

這有可能是LOL傾銷大量的數據出來它的標準輸入輸出流,你是不是從你的進程對象吃。您可能需要啓動一個線程,只是坐在那裏大口大口下來的東西,在Process.getInputStream顯示出來()或Process.getErrorStream

+0

我用了一個StreamGobbler我發現輸入的輸入和錯誤流進它和它的工作就像魔術!謝謝您的幫助 – Rez

相關問題