Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with Runtime.getRuntime.exec()

 
Christian Mousel
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if stream redirection generally works with Runtime.exec, but that method has some pitfalls to avoid.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic