I currently work on Eclipse Juno 4.2 (but problem is connected with older versions of eclipse as well) and I found an irritating issue. When we try to create new class with a default formatter settings, eclipse put an empty line at the end of file.

I tried to figure out by myself how to remove this annoying line and search in formatter options. I found option that could help solve my problem but i found it’s disable by default.

My question is: How to get rid of this line?
It’s not really an empty line. It just appears that way in Eclipse.
When you see the blank line in Eclipse, it means that the last line of the file is terminated by a new line character. That is, the last characters in your Java file are probably
}\n(on *nix, with LF line endings) or}\r\n(CRLF line endings on Windows), followed in each case by the end of the file.You can prove this to yourself using
tailorcaton *nix. If the prompt appears on the same line as the last line of code, then there’s no trailing new line. If the prompt appears on a separate line, then there is a trailing new line character. If there’s a blank line before the prompt, then there’s an empty line in the file.If the above doesn’t convince you, use a hex editor. :o) An empty line would appear as two consecutive line endings:
\n\nor\r\n\r\n(on *nix and windows respectively).There’s nothing wrong with the last line of your file having a new line character at the end. In fact, it’s a good idea to leave it there, because some tools will warn if it’s not there. These tools include Checkstyle (there’s an Eclipse Checkstyle plugin) and
diff.Eclipse allows you to put the cursor there in case you want to add new content to the end of the file. (This isn’t often needed in Java, because most people don’t put more than one top-level type in a file.)
Best just to leave it there, and get used to Eclipse showing it.