TokyoCabinet Linux Install Script
Posted by Kelvin on 06 Dec 2009 at 01:18 am | Tagged as: programming
Updated on Jul 1 2010 for latest versions
export JAVA_HOME=/usr/lib/jvm/current #changeme!
export MYJAVAHOME=$JAVA_HOME
export MYJAVAHOME=$JAVA_HOME
wget http://1978th.net/tokyocabinet/tokyocabinet-1.4.45.tar.gz
tar -zxvf tokyocabinet-1.4.45.tar.gz
cd tokyocabinet-1.4.45
./configure --enable-off64 --prefix=/usr
make && sudo make install
cd ..
wget http://1978th.net/tokyocabinet/javapkg/tokyocabinet-java-1.23.tar.gz
tar -zxvf tokyocabinet-java-1.23.tar.gz
cd tokyocabinet-java-1.23
./configure --prefix=/usr
make && sudo make install
cd ..
You may need bzip2-devel + ?zlib? (RH/Fedora) or libbz2-dev + zlib1g-dev (Debian/Ubuntu) installed before running configure.
Don’t worry about the second bit if you don’t need the java bindings.

Hi
I hava a question to ask.
In ubuntu 9.10
I have stored tokyocabinet-1.4.40.tar.gz and tokyocabinet-java-1.22.tar.gz in /host/linux-lyq/
and extraced it aim dir:
/home/administrator/tokyocabinet-1.4.40 and
/home/administrator/tokyocabinet-java-1.22
then[root@unbuntu]~#
I input the follow code:
cd /home/administrator/tokyocabinet-1.4.40
./configure --prefix=/usr/local/tcserver/
make
make install
then I see info like : Thanks for using Tokyo Cabinet
then I input:
cd
cd /home/administrator/tokyocabinet-java-1.22
./configure --prefix=/usr/local/tcJavaBind --with-tc=/usr/local/tcserver #may be this setting is wrong and I do not know the right setting.
but error happen :
error tcutil.h is requried
Coule you show me why and how to deal with it.
Then I make clean the above ,use the default setting ?
cd /home/administrator/tokyocabinet-1.4.40
./configure
make
make install
cd
cd /home/administrator/tokyocabinet-java-1.22
./configure
make
make install
This time everything is ok
Now I need you help :what’s wrong with the my non-default setting?
Thanks
Hey Yuqian, what’s happening is that because you’re installing TC in a non-standard location, it can’t seem to find your TC headers. I suspect setting LD_LIBRARY_PATH to where you installed TC would fix the build.
Like so:
Do this _before_ running configure on tc-java
Hey Kelvin
So much thanks !
Hey Kelvin
I ask a question again.Need you help!
In ubunt9.10 ,with stardard install code as follow:
cd /home/administrator/tokyocabinet-1.4.40
./configure
make
make install
cd
cd /home/administrator/tokyocabinet-java-1.22
./configure
make
make install
then gedit /etc/profile
I then put the follow two line in it,then restart my computer
export CLASSPATH=$CLASSPATH:/usr/local/lib/tokyocabinet.jar
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lin
then enter tokyocabinet-java-1.22/exmaple
I input
make
no error
but when input
java TCADBEX
there is error Exception in thread main java.lang.UnstatisfiedLinkError
no jtokyocabinet in java.library.path
Would you give an example can be runable?
so much thanks!
Yuqian
Hey Yuqian, java.lang.UnstatisfiedLinkError is a really typical problem.
Assuming your native libraries are installed to /usr/local/lib, I usually solve it by doing this:
I am compiling the exact version as you, using your instructions, on Fedora 13 IA-64.
TC compiles OK, but when I go to compile TC-Java, I get:
hdb.c: In function ‘Java_tokyocabinet_HDB_errmsg’:
hdb.c:35: warning: implicit declaration of function ‘tchdberrmsg’
hdb.c:35: warning: passing argument 2 of ‘(*env)->NewStringUTF’ makes pointer from integer without a cast
hdb.c:35: note: expected ‘const char *’ but argument is of type ‘int’
hdb.c:37: warning: implicit declaration of function ‘throwoutmem’
hdb.c: In function ‘Java_tokyocabinet_HDB_ecode’:
hdb.c:55: error: ‘TCHDB’ undeclared (first use in this function)
hdb.c:55: error: (Each undeclared identifier is reported only once
hdb.c:55: error: for each function it appears in.)
hdb.c:55: error: ‘hdb’ undeclared (first use in this function)
hdb.c:55: error: expected expression before ‘)’ token
hdb.c:56: warning: implicit declaration of function ‘tchdbecode’
.
.
.
….more
Any ideas?
Thanks,
Glen