Eclipse Google Java Style Guide

This article shows how to use the Google Java style with Eclipse IDE. Every organization has its own style guide, in the open-source community different projects have a slightly different style guide. In this article, we will see how to use the official google style guide in Eclipse IDE.

Get the Style Guide

Save the style guide which is a XML file to your local drive.

Open Eclipse Preference

Opening Eclipse settings varies per OS. For example, on macOS open Eclipse -> Preferences.

Add the Google Style formatter to Eclipse

Import the downloaded XML file.

Configure save actions to automatically format code while saving files.

In the Preferences menu type “save actions”, and select Java -> Editor -> Save Actions.