This forum has been archived. Please start a new discussion on GitHub.

Error "no db_java-4.1..."

Running tests in /usr/local/src/IceJ-1.0.0 on RH8.0 , I got this error:

*** running tests in ./test/Freeze/cursor:

starting client... ok
Exception in thread "main" java.lang.UnsatisfiedLinkError: no db_java-4.1 in java.library.path
at java.lang.ClassLoader.loadLibrary(
at java.lang.Runtime.loadLibrary0(
at java.lang.System.loadLibrary(
at com.sleepycat.db.Db.load_db(
at com.sleepycat.db.Db.<clinit>(
at com.sleepycat.db.DbEnv.<clinit>(
at Freeze.DBEnvironmentI.<init>(
at Freeze.Util.initialize(
at Client.main(Unknown Source)
test failed with exit status 1

I was using Sleepy Cat's db-4.1.25 because it's the only one available at their download site. (I didn't remove the db4*-4.0.14-14 RPMs that came with RH 8.0. )

Here's my CLASSPATH:


I'd already built the C++ version of Ice-1.0.0 and run its test suite without any error.

Any advice will be appreciated.


  • mes
    mes California
    The Java version of BerkeleyDB is layered on the C version using JNI, therefore you must have the directory containing in your LD_LIBRARY_PATH.
  • matthew
    matthew NL, Canada

    You also need to add the directory containing the berkeley db shared libraries (such as to your LD_LIBRARY_PATH.

    You can download the older distributions here:

    Regards, Matthew
  • Thanks for your quick responses. But going back to db4.0 and even db3.3 didn't seem to help. I got exactly the same error with them. Obviously it's something in my setup. I checked and rechecked the following:

    - Ice.jar and db.jar in CLASSPATH

    - libdb_java-[4.1, 4.0, 3.3].so in either LD_LIBRARY_PATH or in a directory (e.g., /usr/local/lib) included in /etc/

    - Rebooting a couple of times.

    db4.0 should work for IceJ because it does work for Ice on the same box.

    Any pointers will be appreciated.
  • mes
    mes California
    Strange. Did you try any of the suggestions on Sleepycat's site?
  • Sorry I goofed! I didn't set LD_LIBRARY_PATH correctly.

    The IceJ test suite ran OK with db-4.1.25, but failed at the first Freeze test with db-4.0.14. Here's my setup:

    export CLASSPATH=.:/usr/local/src/IceJ-1.0.0/lib/Ice.jar:/usr/local/src/db-4.1.25/build_unix/db.jar
    export LD_LIBRARY_PATH=/usr/local/src/db-4.1.25/build_unix/.libs
    export ICE_HOME=/usr/local/src/Ice-1.0.0

    Thanks for your help.