JNI UnsatisfiedLinkError when running ant sample on Ubuntu
I've downloaded and built OpenCV top-of-tree 2.4.9 on a stock Ubuntu 12.04 machine, but the official samples/java/ant example dies with the following error when I follow the tutorial instructions:
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.opencv.core.Mat.n_Mat(IIIDDDD)J
I've determined that the library exists and is being loaded through System.loadLibrary()
. I've also used nm
to examine libopencv_java249.so
and I see the following entry for the function:
00000000000fe510 t Java_org_opencv_core_Mat_n_1Mat__IIIDDDD
I've also built a simple standalone JNI project with no OpenCV dependencies to ensure that there's not a wider Java problem on my system, but that works as expected. I've also run the exact same source tree successfully on my OS X system.
I'm at my wits end on this - does anybody have any ideas on how I can debug this further? It feels like there's a linking or symbol decoration problem, but I can't see what. More system details below:
Linux lucid64 2.6.32-42-server #96-Ubuntu SMP Wed Aug 15 19:52:20 UTC 2012 x86_64 GNU/Linux
java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.5) (6b27-1.12.5-0ubuntu0.10.04.1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)