Two Laptop Bag*
The moose likes Java in General and the fly likes Runtime.exec() not working properly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Runtime.exec() not working properly" Watch "Runtime.exec() not working properly" New topic

Runtime.exec() not working properly

Kousik Majumder
Ranch Hand

Joined: Sep 30, 2007
Posts: 229
Hi all,

I am facing a typical behabiour when trying to run
I have written the above code in a jsp file. Running the jsp file it is not executing the batch file.
But if I put the below code after above code in jsp the batch is executed.

Also I have checked that the batch is executing while run from command promt.
Also can somebody confirm me whether the code written after Runtime.exec() will be executed after the exec finished its work or not?

Please help.

Thanks in Advance,
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41155
So you've learned that you need to handle the I/O streams when using Runtime.exec ... for further information, read this article.

As to the second part of the question, that's easy to test, no?

Ping & DNS - my free Android networking tools app
Don't get me started about those stupid light bulbs.
subject: Runtime.exec() not working properly
Similar Threads
Facing weired behaviour using Runtime.getRuntime().exec
DOS command in java program question..
Refreshing a page before forwarding
how to execute shell(unix) through a servlet.
Jsp page is not getting refreshed