Please explain to me how to solve. I can create a text file for multiple lines when i run java on window. However, when execute a java by Qshell based on Iseries box, the text file created only one line with carrige return between lines.
However, I can see all lines correct when open wordPad rather than notepad.
On Windows systems, Java will use CR-LF (\r\n) at the end of a line by default. On Unix-like systems (including the iSeries) it will just use LF, and I believe that on Mac systems it will use CR.
Pretty much every text editor in the world understands that a line can be ended by any of those three combinations of characters. Notepad is one of the tiny minority that doesn't understand that.
So the simplest thing to do is to stop using Notepad. Even Microsoft makes a better editor, Notepad. If you are generating text files that people will read with whatever editor they choose, that isn't going to work, of course. But if it's just something you noticed when you were debugging, then forget about it.