Skip to content

Java Code Style Guide

Jordan Padams edited this page Aug 26, 2024 · 9 revisions

PDS EN has chosen the Google Java Style Guide as our default style guide. As best as possible, try to adhere to this guide.

Java Code Formatter for Eclipse IDE

For integrating this styling into your development workflow for Eclipse:

  1. Download Google Style Guide profile: https://github.com/google/styleguide/blob/gh-pages/eclipse-java-google-style.xml
  2. To set default Format functionality, open Eclipse and go to Eclipse > Settings > Java > Code Style > Formatter > Import > Select downloaded eclipse-java-google-style.xml. This sets your default formatting.
  3. To apply style on Clean up, go to Eclipse > Settings > Java > Code Style > Clean up > Edit > Select Format source code.
  4. To apply style on Save, go to Eclipse > Settings > Editor > Save Actions > Select Perform the selected actions on save > Select Format Source Code

Java Code Formatter for IntelliJ IDEA

For integrating this styling into IntelliJ IDEA, follow the instructions here. Also, there is a more detailed article on configuring and using the code formatter in IntelliJ IDEA is available here.