Installing OpenCV on Raspbian for Java, "Could not FindJNI" -


i'm trying install opencv on raspbian can deploy java code onto rpi. however, having cmake find jni proving irksome task. 1 question answered here noted administrator needed have java_home set well, not user. set in /etc/environment prior setting in .bashrc.

how resolve "could not find jni", building opencv on raspberry pi?

however, cmake still cannot find jni, after updated find include directories noted in following;

cmake find_package(jni) not work in ubuntu 12.04 amd64

i've tried many different combinations, including java installation , environment setting at, though unzips java in /opt/java , recommends setting java_home there;

http://elinux.org/rpi_java_jdk_installation

pertinent findjni.cmake lines include;

set(java_awt_include_directories   "[hkey_local_machine\\software\\javasoft\\java development kit\\1.4;javahome]/include"   "[hkey_local_machine\\software\\javasoft\\java development kit\\1.3;javahome]/include"   "[hkey_local_machine\\software\\javasoft\\java development kit\\${java_install_version};javahome]/include"   ${_java_home}/include   /usr/include    /usr/local/include   /usr/lib/java/include   /usr/local/lib/java/include   /usr/lib/jvm/jdk-7-oracle-armhf/include  <-- added me 

and

java_append_library_directories(java_awt_library_directories   ${_java_home}/jre/lib/{libarch}   ${_java_home}/jre/lib   ${_java_home}/lib   ${_java_home}   /usr/lib   /usr/local/lib   /usr/lib/jvm/java/lib   /usr/lib/java/jre/lib/{libarch}   /usr/lib/jvm/jdk-7-oracle-armhf   /usr/lib/jvm/jdk-7-oracle-armhf/lib   /usr/lib/jvm/jdk-7-oracle-armhf/lib/{libarch}   /usr/lib/jvm/jdk-7-oracle-armhf/{libarch} 

pertinent opencv install script lines include;

cmake -d cmake_build_type=release -d cmake_install_prefix=/usr/local -d build_shared_libs=off  -d with_tbb=on -d build_new_python_support=on -d with_v4l=on -d install_c_examples=on -d install_python_examples=on -d build_examples=on with_qt=on -d with_opengl=on .. make -j 8 sudo make install 

cmake output includes;

-- not find jni (missing: java_awt_library java_jvm_library)
system unknown cmake, create: platform/error pid:6186, boost::interprocess::bad_alloc linux use system, please send config file cmake@www.cmake.org so

i'm @ loss more clues load opencv on raspbian java can used - else need do?

try this.

open terminal < export java_home=/usr/lib/jvm/jdk-7-oracle-armhf 

in case have installed java-7-openjdk-armhf , worked me when building opencv.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -