i need to read some error message in java, i tried to do this in getErrorStream and then readLine, but i got exeption. i added a link to a picture of the error message i want to read http://yfrog.com/0986806495p
TNX
i need to read some error message in java, i tried to do this in getErrorStream and then readLine, but i got exeption. i added a link to a picture of the error message i want to read http://yfrog.com/0986806495p
TNX
You can't
That error message is being displayed on the window manager of the operating system which is not readable.
Your attempt to read from the standard error are failing, probably because that application doesn't write to the standard error in first place.
TrueCrypt isn't your Java program, and Java doesn't have a reasonably workable way to reach into another program's dialog to read the message.
getErrorStream()
would work if TrueCrypt output a text to its standard error, but since it has a dialog to show the user it has little reason to do so.
It's possible that TrueCrypt returns a non-0 exit status if it fails, and you could catch that by using Runtime.getRuntime().exec("TrueCrypt.exe")
, waiting for the resulting process to finish (using Process.waitFor()
) and then checking the exit status you get there. However, you still need someone (or something) to hit the Ok button for you.