tags:

views:

93

answers:

2

Hi,

Just spend 3 straight hours trying to solve the java.lang.UnsatisfiedLinkError: no jtokyocabinet in java.library.path problem in Eclipse in Linux.

  • Downloaded TC and TC-Java sources,
  • Built them both using ./config --prefix=/usr (so everything "JNI" related should be in /usr/lib)
  • Set the LD_LIBRARY_PATH=/usr/lib and CLASSPATH="$CLASSPATH:/usr/local/lib/tokyocabinet.jar" and exported both in .profile
  • Imported tokyocabinet.jar into the project.

Am I missing a setting other than the proper -Djava.library.path=. settings? I can't even find anything on the net about jtokyocabinet on the web or in the documentation. What's the secret sauce to getting this thing to work?

A: 

Yes, you're missing something. Eclipse controls its own classpath, so whatever you set up in the environment outside Eclipse is likely not to have any effect.

You need to go into the properties for your project, find the "Build Path" settings and add the path to your tc.jar (or jars) to your build path there.

It may be easier to set up a /lib directory within your eclipse project, copy your tokyo jar there and add that to your build path. That way, it becomes part of your project (and can move from Eclipse installation to Eclipse installation) rather than being an external system dependency.

Carl Smotricz
Added all the jar paths and even tried the /lib directory trick, but still a no-go. Seriously thinking about trying another product similar to tokyocabinet. Any suggestions?
Marc
Sorry to hear it! Yes, you may be better off using a different DB product. Preferrably one that has a pure Java implementation.
Carl Smotricz
+1  A: 

hi,guy

try to make a link to libjtokyocabinet.so...0 in your JAVA_HOME/jre/lib/i386.

lucifer