Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Prob with exec() methid of Runtime  RSS feed

 
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
 
"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.
 
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!