Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can not read a process?  RSS feed

 
Tamazy Ruben
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
 
Jim Yingst
Wanderer
Sheriff
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!