• Post Reply Bookmark Topic Watch Topic
  • New Topic

Prob with exec() methid of Runtime  RSS feed

 
Jolly Ag
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
im getting a strange problem while using exec() method of Runtime .
Im trying execute a java process thru exec() but if i assigned return tpye(Process) of exce() then my java process doesnt start ..means
if i use Process process =Runtime.getRuntime().exec("java A")then A doesnt start but if i use like ...
Runtime.getRuntime().exec("java A") then A gets started ..
???
tx
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show us the actual code that you are using.
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Jolly
how do u know if the process gets started?
because if u r doing S.o.p() in A then also u'd have to probably use Process.getOutputStream() and read all output from the process A. If you do System.err.println() instead then u'd have to work with Process.getErrorStream() and read in the errors...
as Cindy suggested, it would be more helpful if u can post ur code...
regards
maulin
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!