Skip to content

Spotless 8 for gradle fails with Java-Format 1.29.0 and JDK17 #2693

Description

@YellowFlora

Hello,

we are currently facing problems with Spotless together with the 1.29.0 release of Java-Format in our JDK17 repositories.

We are always getting errors like:

 src/main/java/org/sdase/commons/example/TestApp.java:LINE_UNDEFINED google-java-format(java.lang.NoClassDefFoundError) com/sun/tools/javac/tree/JCTree$JCAnyPattern (...)
 src/main/java/org/sdase/commons/example/TestPojo.java:LINE_UNDEFINED google-java-format(java.lang.NoClassDefFoundError) com/sun/tools/javac/tree/JCTree$JCAnyPattern (...)

Example repository:

SpotlessJavaFormatTest.zip

The errors appear only with JDK17 not with 21 and only since the Java-Format 1.29.0 Version.

Google itself writes in their release notes for that version:

The minimum support JDK version to run google-java-format is now JDK 21. Using google-java-format to format earlier versions of the language is still fully supported, but running the formatter itself on JDK 21 or newer is required.

I understand it like that JDK 17 should still working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions