Error: "Could not initialize class com.sun.jna.Native"


This article describes how to resolve the "Could not initialize class com.sun.jna.Native" error, occurring during Cassandra startup.



Cassandra database throws the following exception while starting:

ERROR o.a.c.service.CassandraDaemon - Exception in thread Thread[MemtableFlushWriter:1,5,main]
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
at org.apache.cassandra.utils.memory.MemoryUtil.allocate( ~[apache-cassandra-2.2.4.jar:2.2.4]
at<init>( ~[apache-cassandra-clientutil-2.2.4.jar:2.2.4]



This issue is typically caused by a noexec flag set on the temporary directory.

There are two possible ways to resolve the issue:

1. Remount tmp directory without noexec flag

2. Configure Cassandra to use another location as a temporary directory. To do that, run the following command:

<Upsource_home>/apps/cassandra/bin/ configure$HOME

Please sign in to leave a comment.

Have more questions?

Submit a request