I'm working with Java in a multi-platform environment (Windows + Linux). Whatever text files we produce, however, should use LF as their EOL sequence.
Is there a way I can force Java to use this EOL sequence regardless on the platform I'm running a program on? I'd like not to have to change the whole program, i.e. all calls to System.out.println and similar should be kept as is, only the *ln at the end of the function should always output an "0x0A" and never "0x0D 0x0A".
I could think of two different ways of doing that, but I don't know if either one is possible:
- override the platform-dependent default EOL sequence
- make Java believe I'm running Linux even when I run my program on the DOS command line
Is any of this possible? Or something else perhaps?