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();
}
它只是說,沒有響應,如果父應用程序仍處於打開狀態,之後我關閉父應用程序,它開始加載和作品。
我用了一個StreamGobbler我發現輸入的輸入和錯誤流進它和它的工作就像魔術!謝謝您的幫助 – Rez