Skip to content

Commit 6baceea

Browse files
authored
Merge pull request #287 from sbt/mkurz-patch-1
Add note about `javafmtFormatterCompatibleJavaVersion := 17`
2 parents 61eb2bf + 7213d85 commit 6baceea

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,16 @@ ThisBuild / javafmtFormatterCompatibleJavaVersion := 17
8282
SBT_JAVAFMT_JAVA_HOME=/path/to/jdk-17 sbt javafmt
8383
```
8484

85+
> [!NOTE]
86+
> Many projects use Java 17 as their baseline today. If that is true for your build, `ThisBuild / javafmtFormatterCompatibleJavaVersion := 17` is often the simplest setup.
87+
>
88+
> The main Java language support changes in `google-java-format` [after `v1.28.0`](https://github.com/google/google-java-format/compare/v1.28.0...v1.35.0) are:
89+
>
90+
> - [Initial support for import module in google-java-format](https://github.com/google/google-java-format/commit/6afe380707ec16884ec2761763ccec998de403d1)
91+
> - [Support Instance Main Methods in google-java-format](https://github.com/google/google-java-format/commit/737b0032b3a18eb6e458271ea440098c166f6c2d)
92+
>
93+
> If you do not use these language features, setting `ThisBuild / javafmtFormatterCompatibleJavaVersion := 17` lets sbt-java-formatter work out of the box on CI servers and developer machines that run sbt on Java 17.
94+
8595
Use `javafmtJavaMaxHeap` to control the maximum heap size passed to that JVM:
8696

8797
```scala

0 commit comments

Comments
 (0)