Formatter - OpenLiberty/liberty-tools-eclipse GitHub Wiki

Java source formatter is here.

Save, then import and use formatter:

  1. Go to Window->Preferences->Java->Code Style->Formatter-> Hit the import button to import it. Make sure the new formatter shows as your active profile from the dropdown. Finally, hit Apply and Close.
  2. Now, since it is a pain to remember to run the formatter, here is how you enable it to run by default on every save you make. Really convenient. Go to Window->Preferences->Java-> Editor-> Save Actions-> Enable “Perform the selected actions on save”, then select Format source code (all lines) and Organize imports.