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
Eclipse plugin fails at runtime when a formatter dependency is not embedded #132
Upstream regression in gjf 1.36.0/1.36.1: the Eclipse plugin throws NoClassDefFoundError: Could not initialize class ...javadoc.MarkdownPositions because org.commonmark was not packaged into the plugin bundle; formatting on save silently does
nothing. 1.35 works. Confirmed by several users; still open.
Why it matters to us: we do not use commonmark, so this exact bug does not affect us. But our
plugin embeds only an allowlist of jars (functionaljava, guava, open-java-format*),
while open-java-format also has implementation dependencies on Jackson
(core/databind/datatype-jdk8/module-parameter-names). Jackson is used by the debug/JSON
output (JsonSink, DebugRenderer, JsonDocVisitor) and annotations on core types
(BreakBehaviour has @JsonSerialize(using = BreakBehaviour.Json.class)), so it is likely
never loaded on the formatting path, but nothing verifies that. Any new runtime dependency
would hit the same failure mode as upstream.
Suggested action: investigate. Load the built plugin jar in a plain classloader with only
the embedded libs and format a file (including Markdown /// Javadoc), or add a build check
that compares runtimeClasspath with embeddedLibs and fails on an unexpected jar.
Filed from an upstream-watch ticket after manual review.
google/google-java-format#1511 fixed google/google-java-format#1428 by bundling commonmark, which only google-java-format depends on. For us the question was whether our plugin needs one of the jars it leaves out. The plugin embeds open-java-format, open-java-format-spi, guava and functionaljava, and leaves out Jackson and jsr305.
I checked it on 21.X.X (6bcacfc). I built the plugin jar, took the four jars from its lib/, and put exactly those on the classpath. With them I made the two calls that SnippetFormatter makes, with the OJF style: Formatter.getFormatReplacements and Formatter.formatSource. The test file had a /// comment, a Javadoc comment and a long string literal. Both calls formatted it, and no class failed to load.
If the formatter ever needs another jar at runtime, the embeddedLibs filter in open-java-format-eclipse-plugin/build.gradle has to list it.
Activity
abashev commentedon Oct 30, 2026
Closing, because this does not reproduce here.
google/google-java-format#1511 fixed google/google-java-format#1428 by bundling commonmark, which only google-java-format depends on. For us the question was whether our plugin needs one of the jars it leaves out. The plugin embeds
open-java-format,open-java-format-spi,guavaandfunctionaljava, and leaves out Jackson and jsr305.I checked it on 21.X.X (6bcacfc). I built the plugin jar, took the four jars from its
lib/, and put exactly those on the classpath. With them I made the two calls thatSnippetFormattermakes, with the OJF style:Formatter.getFormatReplacementsandFormatter.formatSource. The test file had a///comment, a Javadoc comment and a long string literal. Both calls formatted it, and no class failed to load.If the formatter ever needs another jar at runtime, the
embeddedLibsfilter inopen-java-format-eclipse-plugin/build.gradlehas to list it.