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?
Enabling 'Folding' in the preferences dialog lets you use the '+' and '-' buttons next to the line numbers to hide comments. Do do this... Then the comments will go away!
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...".
It's the standard javadoc format. Formatting options in eclipse are in right click your project->properties->Java Code Style->Formatter->Edit->Comments tab, but I don't see an option to disable this particular behavior.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With