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();
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>
Most helpful comment
I added it to my pom.xml in the maven-assembly-plugin.