Repository navigation
Possible issue with Eclipse plugin #1428
Description
Activity
Same issue with
1.36.1.I can confirm the same issue with google-java-format 1.36.x in Eclipse 4.40.0 on Java 21.0.11.
Formatting fails with:
NoClassDefFoundError: org/commonmark/parser/ParserDowngrading the Eclipse plugin to 1.35.0 fixes the problem for me.
Reacted by algonell and ChristianI can confirm this with
google-java-format-eclipse-plugin1.36.1.Environment:
- Eclipse 2026-06 / 4.40
- Java 21.0.11
- Linux GTK
- google-java-format Eclipse plug-in 1.36.1
- Formatting invoked programmatically through an Eclipse/JDT integration
The failure is:
java.lang.ClassNotFoundException: org.commonmark.parser.Parser cannot be found by google-java-format-eclipse-plugin_1.36.1The relevant stack is:
at com.google.googlejavaformat.java.javadoc.MarkdownPositions.<clinit> at com.google.googlejavaformat.java.javadoc.JavadocLexer.lex at com.google.googlejavaformat.java.javadoc.JavadocFormatter.formatJavadoc at com.google.googlejavaformat.java.GoogleJavaFormatter.formatInternalThis appears to be an OSGi packaging problem in the Eclipse plug-in, rather than a missing installation dependency.
The Eclipse installation already contains active org.commonmark and org.commonmark.ext-gfm-tables 0.28.0 bundles, and org.commonmark.parser.Parser is present in org.commonmark_0.28.0.jar. However, the formatter bundle cannot see arbitrary packages from those bundles without explicit OSGi wiring.
In 1.36.1:
-
google-java-format declares commonmark and commonmark-ext-gfm-tables as runtime dependencies: https://github.com/google/google-java-format/blob/v1.36.1/core/pom.xml
-
The Eclipse plug-in build copies only guava and google-java-format: https://github.com/google/google-java-format/blob/v1.36.1/eclipse_plugin/pom.xml
-
The Eclipse bundle manifest lists only those two embedded libraries on Bundle-ClassPath and has no Import-Package or Require-Bundle declaration for CommonMark: https://github.com/google/google-java-format/blob/v1.36.1/eclipse_plugin/META-INF/MANIFEST.MF
Consequently, the embedded google-java-format.jar references CommonMark, but its containing OSGi bundle has no classloader route to it. Merely installing the CommonMark bundles does not resolve that.
Possible fixes would be either:
-
Embed commonmark.jar and commonmark-ext-gfm-tables.jar in the Eclipse plug-in and add them to Bundle-ClassPath, or
-
Add the required Import-Package declarations and provision the matching CommonMark bundles.
Downgrading the Eclipse plug-in to 1.35.0 avoids the regression.
Reacted by algonell, Mihai Nita and LaurentI confirm the issue with 1.36.1 ; 1.35 works.
I think @ChristianHerget correctly identifies the root cause (missing common mark dependency in eclipse packaging).
- added a commit that references this issue
on Sep 23, 2026
Issue:
1.36.0, I have a save action to format automatically, getting this error:java.lang.NoClassDefFoundError: Could not initialize class com.google.googlejavaformat.java.javadoc.MarkdownPositions. See the error log for details.Environment:
Ask me anything, will try to help.