This is assuming you are not running the pure BerkeleyDB Java edition
Make sure you rebuild BerkeleyDB with
and the LD_LIBRARY_PATH
must include /usr/local/BerkeleyDB/lib
If you do not rebuild you will get java.library.path errors even though libdb_java.so is clearly installed. The BerkeleyDB guide is not very helpful in this regard. Why wouldn't Java access be enabled by default. It is very frustrating.