• Post Reply Bookmark Topic Watch Topic
  • New Topic

On Runtime and Process  RSS feed

 
christine clarin
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
question: Can I use only one Runtime and Process Object in executing several external programs? Thanks.

e.g.
Runtime rt = Runtime.getRuntime ();
Process proc = rt.exec (command1);
...waitFor()...
proc = rt.exec (command2);

tnx.
 
Praveen Balaji
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that by doing



you are not affecting the first command (command1), but are only loosing a handle (reference) to it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!