Reputation: 2989
I'm running into an issue in NetBeans where the output window only uses one type of line separator (\n), regardless of build platform.
I'm on a windows machine, building for windows machines specifically. As far as I can tell, \r\n is the default line separator for windows, and the java runtime environment (when running my program from the windows console) seems to respect that. However, netbeans seems to explicitly use \n as its line separator in the output window when I'm debugging, so using \r\n (or System.getProperty("line.separator"), for that matter) as the scanner's line seperator is useless for when I need to type something.
What can I do aside from having to remember to change a constant before I publish my program? NetBeans obviously ignores System.setProperty in this case, and NetBeans doesn't seem to support changing the line separator used in the output window.
(A similar question, How to change the line ending used in Netbeans, seemed promising, although providing -J-Dline.separator=CRLF
as a startup argument to netbeans did not affect the output window, and the show and change line endings plugin only affects files).
Upvotes: 2
Views: 2486
Reputation: 1287
Go to Project Properties -> Run -> Console Type and choose "Standard Output"
Worked for me and might work for you.
Upvotes: 1