一、问题描述
Ubuntu18.04 编译报错 OpenCV 时,出现以下错误:
Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
二、解决方法
先执行以下指令,
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
然后重新编译,如果依旧报错Could NOT find JNI
,那么执行如下指令:
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
参考链接
[1] 收到一只叮咚. CMake找不到JNI [EB/OL]. https://www.imooc.com/wenda/detail/616521, 2021-04-28/2022-10-26.