• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

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

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

Thank You!
 
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!