• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Can not read a process?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone has any idea why input.readLine() would not print?
Here is the code:



I get this error:
java.io.BufferedReader@35ce36

Thanks
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's possible that there's an error message being sent to the error stream. You've created a reader for this stream, but it never reads the contents to print them out they way you do for the standard input stream. Unfortunately there are a numer of potential difficulties that you can encounter when doing this sort of thing; I recommend reading this article for more background. You should probably use the StreamGobbler class discussed there to read both input and error streams in separate threads, and print their contents to the screen. Good luck...
 
Tamazy Ruben
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is rather confusing around exec()

The article was very helpful,

Thank you Jim
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!