This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Problem with Runtime.getRuntime.exec() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Problem with Runtime.getRuntime.exec()" Watch "Problem with Runtime.getRuntime.exec()" New topic

Problem with Runtime.getRuntime.exec()

Christian Mousel

Joined: Mar 15, 2006
Posts: 4

I need some help with my program. I am trying to execute another program from my Java program. It is a program that is usually run from a Command Prompt by typing D:\program\prog<D:\program\input.IN.
Here is my code:

The program prog is supposed to create a couple of output files, using the informations in the file input.IN, but nothing happens.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41046
I'm not sure if stream redirection generally works with Runtime.exec, but that method has some pitfalls to avoid.

Ping & DNS - my free Android networking tools app
It is sorta covered in the JavaRanch Style Guide.
subject: Problem with Runtime.getRuntime.exec()
Similar Threads
readObject() eat memory !!!
how to open the excel file in java program?
Reseting socket after few seconds
Problem with ImageIO.write
hibernate update in single transcation