Richtextfx: JavaFx RichText RunTime Error java.lang.NoClassDefFoundError: org/fxmisc/richtext/TextFlowLayout

Created on 26 Sep 2020  路  4Comments  路  Source: FXMisc/RichTextFX

I have a runtime error for java.lang.Exception: java.lang.NoClassDefFoundError: org/fxmisc/richtext/TextFlowLayout. I'm using java14 and JavaFx13. I use Maven to download the dependencies and use the maven-assembly-plugin to package my dependencies in a single jar. I already added in require org.fxmisc.richtext in module-info.java. At design time, the class call works. But not at runtime.

Mavem:

<dependency>
    <groupId>org.fxmisc.richtext</groupId>
    <artifactId>richtextfx</artifactId>
    <version>0.10.5</version>
</dependency>

The error occurs when instantiating the class in Runtime:

CodeArea codeArea = new CodeArea();

Most helpful comment

I added it to my pom.xml in the maven-assembly-plugin.

                    <manifestEntries>
                        <Multi-Release>true</Multi-Release>
                    </manifestEntries>

All 4 comments

I'm guessing that's because the RichTextFX multi-release jar isn't being repackaged properly into the single jar.

If I remember correctly the manifest of the repackaged jar must contain: Multi-Release: true and also make sure that the META-INF folder has a versions\9\org\fxmisc\richtext substructure containing files.

Multi-Release: true

Thanks, the manifest file was missing the Multi-Release: true

Great :-) 聽Is that maybe a bug with the maven-assembly-plugin ?

I added it to my pom.xml in the maven-assembly-plugin.

                    <manifestEntries>
                        <Multi-Release>true</Multi-Release>
                    </manifestEntries>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

oowekyala picture oowekyala  路  10Comments

Kim4444 picture Kim4444  路  5Comments

AleKrabbe picture AleKrabbe  路  7Comments

ASchmidt84 picture ASchmidt84  路  9Comments

garybentley picture garybentley  路  11Comments