SyntaxFix
Write A Post
Hire A Developer
Questions
Try wrapping your FileWriter in a BufferedWriter:
FileWriter
BufferedWriter
BufferedWriter bw = new BufferedWriter(writer); bw.newLine();
Javadocs for BufferedWriter here.