Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

failed to use System.loadLibrary(Core.NATIVE_LIBRARY_NAME) on Raspberry pi

Hi All,

I compiled the opencv latest sources on my Raspberry pi (for java) and i got the following files (among others) and opencv_java.jar

So far so good, but when i try to load the library in my java program, it fails to do so saying that the source can't be found.

I have tried several ways to load the file and i get the following errors : System.loadLibrary(Core.NATIVE_LIBRARY_NAME);

returns error (in debug mode):
Source not found.

Additionally, i have found that if i look inside the Core class in org.opencv.core , the return for this is :
private static String getNativeLibraryName() { return "opencv_java400"; } and not

did i miss something or is this correct ?

String libName = "";
libName = "";
System.load(new File("/home/pi/workspace/ro.romaniasoft.FRI/libs/".concat(libName)).getAbsolutePath());

returns error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library:


returns error (in debug mode):
Source not found.

I have added the native path in my Java Build Path - > opencv_java.jar -> native library location to "/home/pi/opencv/build/lib"

I also tried to copy the "" to "/usr/lib/jvm/java-8-openjdk-armhf/jre/lib/arm"

Apparently Nothing works. I'm stuck at this Load Library step.

Could you please help me ?