This plugin enables the integration of any Java formatter into the project.
Unlike other formatters, the SDK of the project is used instead of the Intellij VM when the formatter is called. This solves the problem where formatters could not format code from a newer SDK.
The configuration panel allows you to select the main class and specify further parameters.
The configurable-java-format formatter, based on the google-java-format style but with a line length of 120 characters, is set as the default setting.
-
Using IDE built-in plugin system:
Settings/Preferences > Plugins > Marketplace > Search for " external-java-format-intellij-plugin" > Install Plugin
-
Manually:
Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...
Plugin based on the IntelliJ Platform Plugin Template.