It is an absolute requirement of portable files that the last line should end in a newline. If you are in doubt, try typing final newline into google. You should get about 100,000 hits, which tells you it is an extremely common problem. Also, think about it logically. What other convention allows you to tell the difference between a last line that doesn't exist and a last line that is there but empty?
Unfortunately, the convention in most editors, even the best ones like emacs
or jedit or textpad, is by default not to add extra characters you didn't ask
for, even if they are essential to create a correct file. All editors I know
of, though,(except jedit) have a preferences setting, or similar, to switch
this on (e.g.
emacs:
help/customise/browse/editing/editing-basics/require-final-newline,
textpad: configure/preferences/editor: "Automatically terminate the last line
of the file").
Removing an apparent blank empty line at the end of an editor buffer is a mistake. The usual convention in editors is that the cursor can be at any position between characters, including before the first or after the last. The position after the last newline of the last line puts you on an apparent but non-existent "blank" line (which is the right place if you just typed the newline, so it is not a bad convention). If you are in any doubt about the contents of the file, use the Unix command "od -c" or equivalent.