Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

"JNI : Linux java.lang.UnsatisfiedLinkError

846238Jun 6 2011 — edited Jun 6 2011
Hi All,



My bundles use JNI to communicate to the native code.

My native code further uses Sqlite3 libraries.



Please let me know how to link the the libraries:

Command I have used to generate the JNI shared library:

1.

gcc -I/java/jdk/include -I/java/jdk/include/genunix -c DbOperations.c -o DbOperations.o

ld -shared -f /usr/lib/libuuid.so DbOperations.o -o DbNativeInterface.so



2.

gcc -o libDbNativeInterface.so -shared -Wl,-soname,DbNativeInterface.so

-I /usr/lib/jvm/java-6-sun-1.6.0.22/include/

-I /usr/lib/jvm/java-6-sun-1.6.0.22/include/linux/ -I /<My path to>/SQLite/inc/ DbOperation.c



Using this so file in the bundle throws following error:

Couldn't start bundle: DataAccess (#22) (due to: java.lang.UnsatisfiedLinkError:

/home/user/knopflerfish_osgi_sdk_3.0.0/osgi/fwdir/bs/22/jar0/libDbNativeInterface.so:

/home/user/knopflerfish_osgi_sdk_3.0.0/osgi/fwdir/bs/22/jar0/libDbNativeInterface.so: undefined symbol: sqlite3_open)

java.lang.UnsatisfiedLinkError: /home/user/knopflerfish_osgi_sdk_3.0.0/osgi/fwdir/bs/22/jar0/libDbNativeInterface.so:

/home/user/knopflerfish_osgi_sdk_3.0.0/osgi/fwdir/bs/22/jar0/libDbNativeInterface.so: undefined symbol: sqlite3_open



Please guide with solutions or suggestions if any

Thank you

Vinay

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 4 2011
Added on Jun 6 2011
2 comments
491 views