Java Runtime exec can hang

Today I was trying to extract the windows eventlog entries in my win-xp box. I have used Eldump to do this. please see my earlier post about this tool . I have used runtime.exec() to execute this command and extracted the information from the process streams.

The program was extracting the log entries, but hang in between, and went for endless sleep; i.e, the process never ended. Later with some googling, I was adviced to read error stream first, and then process output stream. Also both the streams need to be read concurrently with two threads. This could solve my issue. Try then!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s