google-java-format icon indicating copy to clipboard operation
google-java-format copied to clipboard

Increasing minimum supported JDK (and dropping support for JDK 11)

Open cushon opened this issue 1 year ago • 4 comments

Following the example of https://github.com/google/error-prone/issues/3803, we're considering removing support for running google-java-format on JDK 11. The new minimum supported JDK would be JDK 17 (the next LTS release after 11).

google-java-format would still fully support formatting earlier source code versions, it would just require running the tool on JDK 17 or later.

cushon avatar Sep 11 '24 21:09 cushon

Doesn't the runtime version determine the source code version at the moment? Or does GJF support a --source 11 option? 🤔

sormuras avatar Sep 12 '24 06:09 sormuras

Afaict it determines what can be parsed but not how it'll be formatted.

tbroyer avatar Sep 12 '24 06:09 tbroyer

Afaict it determines what can be parsed but not how it'll be formatted.

Right, it'll parse at whatever the newest language level supported by the runtime is, and shouldn't affect formatting. Newer source versions are usually a superset of older ones, but there are some occasional breaking changes like new reserved identifiers, #975 is a related FR about making the source version g-j-f parses at configurable.

cushon avatar Sep 12 '24 15:09 cushon

I just pushed another release, and am planning to update the minimum supported JDK to 17 for the next release after that one: https://github.com/google/google-java-format/releases/tag/v1.24.0

cushon avatar Oct 04 '24 17:10 cushon

I pushed 1.25.0, which raises the minimum supported JDK to JDK 17: https://github.com/google/google-java-format/releases/tag/v1.25.0

(I previously mistakenly updated the release notes for 1.24.0, I have finished publishing the 1.25.0 release and restored the 1.24.0 relnotes, sorry for the mixup.)

cushon avatar Nov 19 '24 01:11 cushon