Java HiveMQ client error when starting on Raspberry Pi

I’m experimenting with HiveMQ client in a Java application on the Raspberry Pi but get this error on start-up of my application:

[main] INFO io.netty.util.internal.PlatformDependent - Your platform does not provide complete low-level API for accessing direct buffers reliably. Unless explicitly requested, heap buffer will always be preferred to avoid potential system instability.
Exception in thread "main" java.lang.NoClassDefFoundError: sun/misc/Unsafe
	at jctools.core@2.1.2/org.jctools.util.UnsafeAccess.<clinit>(UnsafeAccess.java:46)
	at jctools.core@2.1.2/org.jctools.queues.BaseSpscLinkedArrayQueueConsumerField.<clinit>(BaseSpscLinkedArrayQueue.java:47)
	at com.hivemq.client.mqtt@1.2.2/com.hivemq.client.internal.mqtt.handler.publish.outgoing.MqttOutgoingQosHandler.<init>(MqttOutgoingQosHandler.java:92)

Any ideas what could be wrong?

And of course, right after posting this question, I found the answer on SO :wink:

Needed to add this to module-info

requires jdk.unsupported;
1 Like