2015-10-31 52 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

相关问题