How to resolve "Could not find JNI" problem, building OpenCV on Raspberry Pi?

asked 2013-08-29 09:37:33 -0500

DmitryD13 gravatar image


I try to build opencv with Java on Raspberry Pi (Debian 4.6.3) and get every time an error from cmake: Could not find JNI (missing: ...). I used this documentation ( I have been searching for solution in the Internet for a while. The suggestions were set JAVA_HOME variable, install ant, install python, add ${JAVA_HOME}/bin variable to the PATH variable. Unfortunately, nothing has helped me yet. I tried everything, I even tried to completely remove opencv ( from the Raspberry Pi, download another Version (2.4.6) and build it with cmake - nothing worked. I have two jre's on the Raspberry Pi: one (probably) preinstalled "Java-6-openjdk-armhf" and one, I installed by myself "Java Early Access" (jdk1.8.0 - speciffically for Raspbian with hardfloat). I tried to set JAVA_HOME to "/home/pi/java/jdk1.8.0" (where I installed "Java Early Access") and "/home/pi/java/jdk1.8.0/", The Problem seems to be that cmake cannot find jni.h file, which usually can be found in "JAVA_HOME/include/". I checked this file and I have it; if I type "ls $JAVA_HOME/include/" in the shell, I get files with jni.h among them. So, I am out of ideas. Please, help me, if you know how to solve my Problem.

Thanks in advance!


edit retag flag offensive close merge delete