/ Java

Executing external process using java

Runtime rt=Runtime.getRuntime(); 
Process x= rt.exec("ls -l"); 
BufferedReader stdInput = new BufferedReader(new InputStreamReader(x.getInputStream())); 
String s; 
while ((s = stdInput.readLine()) != null) { 
  System.out.println(s); 
}
Prashanth Madi

Prashanth Madi

I'm a programmer & Tech enthusiast. I work for OpenSource Support Team at Microsoft, but this blog, its content & opinions are my own. I blog about tech, gadgets, code, where we're going & we've been.

Read More