Last Updated: February 25, 2016
·
1.135K
· belaezsias

Using RocksDB from SBT

I had some trouble with RocksDB in Scala/SBT setup so this is how I made it work.

Clone the RocksDB from GitHub.

git clone https://github.com/facebook/rocksdb.git

Open NativeLibraryLoader.java file and change the

InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream(sharedLibraryName);

line to

InputStream is = NativeLibraryLoader.class.getClassLoader().getResourceAsStream(sharedLibraryName);

This is needed otherwise it won't be able to find the shared library.

cd rocksdb
make rocksdbjava

When finished, copy the resulting rocksdbjni[ver-os].jar into the lib directory of your sbt project.

That's all...