官方安装教程
http://docs.opencv.org/3.1.0/d9/d52/tutorial_java_dev_intro.html#gsc.tab=0
注意要先安装jdk和apache ant。不然不能成功。
wget http://apachemirror.ovidiudan.com//ant/binaries/apache-ant-1.9.7-bin.zip
unzip ~/apache-ant-1.9.7-bin.zip
设置ANT_HOME
添加$ANT_HOME/bin到PATH
wget https://codeload.github.com/Itseez/opencv/zip/3.1.0
unzip 3.1.0
cd opencv-3.1.0/
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=OFF ..
make -j8
最后两个资源的位置
build/bin/opencv-310.jar
build/lib/libopencv_java310.so
最后附一个mac安装opencv教程
http://opencv-java-tutorials.readthedocs.io/en/latest/01-installing-opencv-for-java.html#install-the-latest-java-version