Skip to content

Possible issue with Eclipse plugin #1428

Description

@algonell

Issue:

  • Just bumped to 1.36.0, I have a save action to format automatically, getting this error:
    • A save participant caused problems. The save participant 'Code Clean Up' caused an exception: java.lang.NoClassDefFoundError: Could not initialize class com.google.googlejavaformat.java.javadoc.MarkdownPositions. See the error log for details.
  • Explicit invocation of the formatter (Shift + Ctrl + F) does nothing.
  • External runs via java -jar are fine.

Environment:

  • Eclipse IDE for Java Developers (includes Incubating components)
  • Version: 2026-06 (4.40.0)
  • Build id: 20260604-0653
  • OS: Linux, v.7.1.5-arch1-2, x86_64 / gtk 3.24.52, WebKit 2.52.5
  • Java vendor: Eclipse Adoptium
  • Java runtime version: 21.0.11+10-LTS
  • Java version: 21.0.11

Ask me anything, will try to help.

Activity

  1. algonell commented on Jul 31, 2026

    @algonell
    Author

    Same issue with 1.36.1.

  2. bvo42 commented on Aug 24, 2026

    @bvo42

    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/Parser

    Downgrading the Eclipse plugin to 1.35.0 fixes the problem for me.

  3. ChristianHerget commented on Aug 27, 2026

    @ChristianHerget

    I can confirm this with google-java-format-eclipse-plugin 1.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.1
    

    The 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.formatInternal
    

    This 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:

    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:

    1. Embed commonmark.jar and commonmark-ext-gfm-tables.jar in the Eclipse plug-in and add them to Bundle-ClassPath, or

    2. Add the required Import-Package declarations and provision the matching CommonMark bundles.

    Downgrading the Eclipse plug-in to 1.35.0 avoids the regression.

  4. lalmeras commented on Sep 23, 2026

    @lalmeras

    I 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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions