Skip to content

Commit

Permalink
Update the README to point to JetBrains documentation where appropriate.
Browse files Browse the repository at this point in the history
Fixes #1136

PiperOrigin-RevId: 666123041
  • Loading branch information
plumpy authored and google-java-format Team committed Aug 22, 2024
1 parent 3fe163b commit 46cdb70
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,24 @@ is available from the plugin repository. To install it, go to your IDE's
settings and select the `Plugins` category. Click the `Marketplace` tab, search
for the `google-java-format` plugin, and click the `Install` button.

The plugin will be disabled by default. To enable it in the current project, go
to `File→Settings...→google-java-format Settings` (or `IntelliJ
IDEA→Preferences...→Other Settings→google-java-format Settings` on macOS) and
check the `Enable google-java-format` checkbox. (A notification will be
presented when you first open a project offering to do this for you.)
The plugin will be disabled by default. To enable,
[open the Project settings](https://www.jetbrains.com/help/idea/configure-project-settings.html),
then click "google-java-format Settings" and check the "Enable
google-java-format" checkbox.

To enable it by default in new projects, use `File→Other Settings→Default
Settings...`.
To enable it by default in new projects,
[open the default settings for new projects](https://www.jetbrains.com/help/idea/configure-project-settings.html#new-default-settings)
and configure it under "Other Settings/google-java-format Settings".

When enabled, it will replace the normal `Reformat Code` and `Optimize Imports`
actions.

#### IntelliJ JRE Config

The google-java-format plugin uses some internal classes that aren't available
without extra configuration. To use the plugin, go to `Help→Edit Custom VM
Options...` and paste in these lines:
without extra configuration. To use the plugin, you need to
[add some options to your IDE's Java runtime](https://www.jetbrains.com/help/idea/tuning-the-ide.html#procedure-jvm-options).
To do that, go to `Help→Edit Custom VM Options...` and paste in these lines:

```
--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
Expand Down

0 comments on commit 46cdb70

Please sign in to comment.