Preferences -> Java -> Editors -> Save Actions Check "Perform the selected actions on save", then check "Additional actions" and click the "Configure.." button. In the "Code organizing" tab, check "Remove trailing whitespace"
That will do the job for any normal code, however this does not look to have any effect on the comments. Is there any way to automatically get rid of trailing spaces from the commented lines?
Thanks,
p