commonmark-java icon indicating copy to clipboard operation
commonmark-java copied to clipboard

java.lang.NoSuchMethodError: No static method requireNonNullElseGet

Open dlisagod opened this issue 9 months ago • 2 comments

Steps to reproduce the problem (provide example Markdown if applicable):

my markdown

Expected behavior:

expected HTML

Actual behavior:

actual HTML

(Also see what the reference implementation does: https://spec.commonmark.org/dingus/)

java.lang.NoSuchMethodError: No static method requireNonNullElseGet(Ljava/lang/Object;Ljava/util/function/Supplier;)Ljava/lang/Object; in class Ljava/util/Objects; or its super classes (declaration of 'java.util.Objects' appears in /system/framework/core-oj.jar) at org.commonmark.parser.Parser$Builder.getInlineParserFactory(Parser.java:314) at org.commonmark.parser.Parser$Builder.-$$Nest$mgetInlineParserFactory(Unknown Source:0) at org.commonmark.parser.Parser.(Parser.java:43) at org.commonmark.parser.Parser.(Unknown Source:0) at org.commonmark.parser.Parser$Builder.build(Parser.java:137)

My runtime is jdk 17 ,android sdk 34.I see the same issue before #369 .And my commonmark version is lastest 0.24.0. Why would i get this bug.I see the source code in github it doesnt use requireNonNullElseGet

Image

dlisagod avatar May 07 '25 01:05 dlisagod

Yeah, this is fixed by:

  • https://github.com/commonmark/commonmark-java/pull/369

Just not released yet.

robinst avatar May 07 '25 01:05 robinst

Yeah, this is fixed by:

Just not released yet.

ok i will use the source code instead

dlisagod avatar May 07 '25 02:05 dlisagod

Released in 0.25.0 now: https://github.com/commonmark/commonmark-java/releases/tag/commonmark-parent-0.25.0

robinst avatar Jun 20 '25 13:06 robinst