When adding a multi-line comment in Eclipse and format it(Ctrl+Shift+F), it automatically places an asterisk (*) at the beginning of each new line inside the comment block.
/*
* this is my comment
*/
What is the reason of this behavior?
How can I disable it?
In Eclipse 4.2 and later, the solution is: Window -> Preferences -> Java -> Code Style -> Formatter ->
$profileName -> Edit... () -> comments ->* un-check [ ] Enable block comment formatting.
Note that the author asked for block comments (/*
) and not for Javadoc comments (/**
).
To supress leading * for Javadoc comments un-check [ ] Enable Javadoc comment formatting
(*) If $profileName -> Edit... doesn't work, create a new template using "New...".