System.getProperty("line.separator") is different from "\n" in that the former returns the OS line separator (not always \n). \n is just a line feed, and when you open your output file in a program that does not interpret \n as a new line (say, Notepad on Windows) you won't see that new line.