• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

As a command it runs fine from cmd prompt but not from java code

 
sahana mithra
Ranch Hand
Posts: 72
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code given below actually tries running a command. This command when run from command prompt, produces the necessary output. But when i try to run the application from java code, it keeps on running and doesn't produce any output file.



Thanks
 
Swastik Dey
Rancher
Posts: 1601
5
Android Java Java ME
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From a single command prompt can you execute three executable files at the same time, probably no. You have to execute one at a time. So you probably code should look somewhat like this.

 
sahana mithra
Ranch Hand
Posts: 72
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
The format is not as i have given. I have just shown a sample. It l be like arg[0]+cnst[1]+cnst[2]+arg[1]+cnst[3]+cnst[4]+cnst[5]+arg[2]. Any other way to do this???
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Very common problem - carefully read the JavaDocs for java.lang.Process - take note of the part about the necessity of consuming the stdout, and sterr streams.

A search for "java exec process problem" will find more help.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic