Duhh… It may waste a little time (Java part only) so I thought better make it a blog post; so that everybody can save some time.
Get your copy of TokyoCabinet and Java API ( both are available on same page ) and extract them; First you will have to compile TokyoCabinet and that I think is pretty simple; I compiled my copy disabling bzip and enabling 64 bit offset like this
./configure —disable-bzip —enable-off64
make
sudo make install
sudo ldconfig
Make sure you don’t get any errors; if you do google will help you out here.
Time for Java API where things got messy for me to figure out; for this you have to make sure you have openjdk-6-jdk installed (I also had openjdk-6-source on my system).
Once done go to tokyocabinet Java API source directory and now if you do a ./configure you will get an error saying:
configure: error: jni.h is required
After doing some find commands on my /usr/lib/jvm I figured out the problem and here is how you can solve the niche
CPPFLAGS=”-I/usr/lib/jvm/java-6-openjdk/include/” ./configure
Note the path /usr/lib/jvm/java-6-openjdk/include/ is the path were your jni.h is present; this will vary distro to distro and you can easily google for it. Once done under ubuntu doing a simple make will once again give you a huge list of errors (yep you guessed it). Here is how you will fix that under ubuntu (solution will vary from distro to distro):
INCLUDEDIR=/usr/lib/jvm/java-6-openjdk/include make
Bummers I got some errors again; but this time I modified the Makefile (Again will vary from distro to distro)
JAVAC = /usr/bin/javac
JAVACFLAGS = -source 1.4 -d .
JAR = /usr/bin/jar
JAVAH = /usr/bin/javah
JAVADOC = /usr/bin/javadoc
JAVARUN = /usr/bin/java
this time
INCLUDEDIR=/usr/lib/jvm/java-6-openjdk/include make
sudo make install
sudo ldconfig
works fine. Once compiled don’t forget to copy the libjtokyocabinet.so to your jre lib binaries (sudo cp /usr/local/lib/libjtokyocabinet.so /usr/lib/jvm/java-6-openjdk/jre/lib/i386/.). You can go ahead enjoy the treat of adding the .jar files as dependencies and have fun with the cabinet!
Design by Simon Fletcher. Powered by Tumblr.
© Copyright 2010