aspose file tools*
The moose likes I/O and Streams and the fly likes Runtime.getRuntime().exec() not printing output Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Runtime.getRuntime().exec() not printing output" Watch "Runtime.getRuntime().exec() not printing output" New topic
Author

Runtime.getRuntime().exec() not printing output

Jiss Elizabeth
Greenhorn

Joined: Jul 28, 2004
Posts: 19
Hi,

Am trying to print the java version using the following code. Could some one help me out with this. I used "java -version" as an example. I am trying to print the version of a software on my machine. Somehow exec command is not taking the argument or am doing something wrong (which i think is the case). If i just type in "java" it prints the output.


Thank You!
Jiss Elizabeth
Greenhorn

Joined: Jul 28, 2004
Posts: 19
Hi,

I solved the problem as the output was printing to the error stream instead of the input stream!

Thank You!
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

Jiss Kv wrote:Hi,

I solved the problem as the output was printing to the error stream instead of the input stream!

Thank You!


You may have just masked other problems. You should read the 4 sections of the traps article and implement ALL the recommendations.


Retired horse trader.
 Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Runtime.getRuntime().exec() not printing output