I am calling a command as below: Process proc = Runtime.getRuntime().exec(JavaAppCommand); Although it starts the java command of another application after few seconds it hangs. I don't see any error and it stays like this forever! I have set stdErr as well but dont see any errors in display. Java experts - Kindly assist, Thanks, Puneetha
try { Process p = Runtime.getRuntime().exec(JavaAppCommand); BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream())); String line = null; while ((line = in.readLine()) != null) { System.out.println(line); } } catch (IOException e) { e.printStackTrace(); } Code (markup): Source
Thanks friend. Really appreciated. The code you have mentioned i was already using it. I found out by using this helpful tutorial.