Skip to content
Advertisement

Sqlite4java on Raspberry Pi

I want to use my java project on Raspberry Pi. This code depends on sqlite4java which uses native implementations for many platforms including arm processors link.

The problem is that java can’t load required sqlite wrapper for arm processor. I was doing the follows:

  1. Copied all version (tried one by one) of precompiled libraries (libsqlite4java-linux-armv5te.so, libsqlite4java-linux-armv7a.so, libsqlite4java-linux-arm.so) which I renamed to libsqlite4java-linux-arm.so.

  2. Command java -Djava.library.path=. -jar sqlite4java.jar -d gives output:

    JavaScript
  3. Tried to set up LD_LIBRARY_PATH to /usr/lib/arm-linux-gnueabihf and /usr/lib

On given path file exists. I had installed sqlite3 and libsqlite3-dev. I’m using the latest raspbian distro on QEMU emulator:

JavaScript

Any help will be useful.

Thanks!

Advertisement

Answer

Finally I found solution. I had to build library file on Raspbian. Here are steps:

  1. Get sources from here
  2. Get sqlite_wrap.c file from here
  3. Put sqlite_wrap.c to sources directory. You need native, sqlite directories and sqlite_wrap.c file there.
  4. Create RELEASE file with content:

    JavaScript
  5. chmod +x RELEASE and run it ./RELEASE.

  6. libsqlite4java-linux-arm.so will be built, you need to copy it in proper path of your application.
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement