Eclipse: Configure to Automatically Update Code Formatting on Saving

× Attention:   This tutorial assumes you've already configured your code style formatting in Eclipse the way you'd like.

This tutorial shows you how to configure Eclipse to automatically clean up your code formatting anytime you save your code. Keeping your code formatting clean helps prevent mistakes and frustration, saving you time!

  1. In Eclipse, choose Window menu > Preferences:

  2. In the Filter text box, type save. Eclipse automatically updates the categories in your Preferences window:

  3. Choose the Saved Actions category:

  4. In the Saved Actions settings, do the following:

    • Check ON Perform the selected actions on save

    • Check ON Format source code

    • Select Format all lines

  5. Hit the Apply and Close button to save your settings.