Cassandra and java.lang.UnsatisfiedLinkError: no snappyjava in java.library.path Error

I’m running Apache Cassandra on my MAC OS 10.9.4 and while running it I got below error in my Eclipse Console. Seems only appears on MAC OS X. No error on Windows system.

java.lang .reflect.InvocationTargetException Error for Snappy Java Cassandra and java.lang.UnsatisfiedLinkError: no snappyjava in java.library.path Error

java.lang .UnsatisfiedLinkError no snappyjava in java.library.path  Cassandra and java.lang.UnsatisfiedLinkError: no snappyjava in java.library.path Error

Java Version I’m running:

No snappy-java in java.library.path” (JDK 1.7 issue?). Snappy compression doesn’t work with JDK7 on Mac OSX. It turns out this is a path bug with Snappy affecting Java 7 on OS X and it does’t part of Mac version of Java. The only solution is to have it available in your Eclipse project.

You could solve this in two different ways:

1) Download Jar: http://central.maven.org/maven2/org/xerial/snappy/snappy-java/ and include into your project class path.
2) If you have maven project just add to your maven dependancy.

There are the basic features of Snappy Library:

  • JNI-based implementation to achieve comparable performance to the native C++ version.
    • Although snappy-java uses JNI, it can be used safely with multiple class loaders (e.g. Tomcat, etc.).
  • Supporting compression/decompression of Java primitive arrays (float[]double[]int[]short[],long[], etc.)
  • Fast compression/decompression tailored to 64-bit CPU architecture.
  • Portable across various operating systems; Snappy-java contains native libraries built for Window/Mac/Linux (64-bit). snappy-java loads one of these libraries according to your machine environment (It looks system properties, os.name and os.arch).

Hope this resolves your above Snappy Java Error. Let me know for any query you have. List of all Java Tutorials.

If you enjoyed this post, make sure to subscribe to Crunchify's RSS feed.