This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General and the fly likes How to get a value from process Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to get a value from process" Watch "How to get a value from process" New topic

How to get a value from process

rajashree loganayagi

Joined: Apr 12, 2011
Posts: 20

i wrote a code for executing the batch file using socket program.

i need to get the content of the batch file which has to be sent as a request to the server.

but i cant able to get the content.

Here are my codes :

The problem is that while printing the "line" variable, i get no response in the console.
Can any one please help me....

Thanks in advance.
Rob Spoor

Joined: Oct 27, 2005
Posts: 19557

Moving to Java in General.

Also, read this. You either need to read from p.getErrorStream() as well, in a different thread, or use ProcessBuilder with redirectErrorStream(true) instead of Runtime.exec to create the Process.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: How to get a value from process
Similar Threads
Another Runtime Problem
how to finish the process forcibly?
file input... please help
list of sql servers
Runtime.getRuntime().exec(s) spaces in s are trimed