Best Way to Keep Java Code Clean and Organized Using Eclipse


Eclipse IDE Java Editor Save Actions option should be used by all developers as it helps to keep code clean and organized.

Eclipse is the most widely used IDE for Java programming as it provides a lot of features and it has the support of many free and paid plugins. Most important it is free to use and works flawlessly on any platform like Windows, Mac, Linux Desktops.

For most of the works, it’s default settings are enough to do development work for most of the people.

Eclipse provides one option to keep your code clean, organized, pretty, and most important it can modify your code automatically to make correct use while you save your code.

To enable and customize this option you simply need to open Preferences-> Java-> Editor-> Save Actions and check to “Perform the selected action on save”.

eclipse-save-actions-1

After this check Format Source Code, Organize Imports and Additional actions then click on configure.

eclipse-save-actions-2

Now you can configure code organizing, code style, member accesses, missing codes, and Unused code options. This option should be configured based on your own preferences and practices you follow.

eclipse-save-actions-3I personally don’t like to auto-sort members and removed unused local variables and private function removals. So I don’t enable that in organizing and cleanup.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.