I have some code that does a Runtime exec and parses the results. On linux and Windows7, the code works fine for parsing the system commands, but on Win XP I am getting a blank line ("") between each line that has content. Any ideas what might be happening here?
Process output = Runtime.getRuntime().exec(command);
BufferedReader br = new BufferedReader(new InputStreamReader(output.getInputStream()));
while ((line = br.readLine()) != null)
Try reading the output stream directly, character by character, and see if the end of line characters are different. This might depend on the specific command you're running.
以上就是Double linebreak with BufferedReader on Win XP, but not other OSs...same code的详细内容，更多请关注web前端其它相关文章！