My requirement is to generate a text file.I added the new line in my file using bufferedWriter.newLine() its working fine in windows but its not working in linux. I tried too many things but nothing is worked out so for.If i open the generated text file in notepad++ its show as line separated but in notepad it looks with out any line separator.In the console i can find the new line in both the platform but the file only windows has the new line but not in linux.
Below is my code
File file = new File(fileToWrite);
bufferedWrtier = new BufferedWriter(new FileWriter(file));
LOGGER.debug("Line Separator 1:: "+System.getProperty("line.separator"));
LOGGER.debug("Line Separator 2:: "+System.lineSeparator());
LOGGER.debug("Line Separator 3:: "+SystemUtils.LINE_SEPARATOR);
bufferedWrtier.write(System.getProperty("line.separator"));
bufferedWrtier.write(System.lineSeparator());
bufferedWrtier.write(SystemUtils.LINE_SEPARATOR);
Any help will be greatly appreciated!!!!!!!!!!
Local Machine Os: windows Server Machine Os: Linux