一、问题描述
Ubuntu18.04 编译报错 OpenCV 时,出现以下错误:
powershell
Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
二、解决方法
先执行以下指令,
powershell
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
然后重新编译,如果依旧报错Could NOT find JNI ,那么执行如下指令:
powershell
sudo apt-get install -y openjdk-8-jdk
sudo apt-get install -y default-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64