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

Answered

Hi,

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(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)

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

Has someone a clue? Thanks !

 

0
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?

0

Please sign in to leave a comment.