created jar shows error: java.lang.NoClassDefFoundError with paho mqtt5



in my project I am using paho mqtt5, with maven dependency.
It works like a charm if I run the project from the IDE. But after I created a jar file, the following messag appears :

Caused by: java.lang.ClassNotFoundException: org.eclipse.paho.mqttv5.client.MqttClientPersistence
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(
        at java.base/java.lang.ClassLoader.loadClass(

In the artifacs I include the jar - files but the mqtt5 class is not found.

Has someone a clue? Thanks !


1 comment

Hello, Frank!

Can you please provide a screenshot of the "Artifacts" page with "Show content of elements" checkbox enabled (make sure all of the options in its' submenu are enabled as well) and the part of pom.xml with the corresponding dependency's declaration?


Please sign in to leave a comment.