准备
yum -y install epel-release
yum install gcc gcc-c++  
yum install cmake 
yum install python-devel numpy 
yum install ffmpeg-devel   //如果之前已经安装过ffmpeg就不需要了
yum install -y unzip zip
下载
wget -O opencv.zip https://github.com/Itseez/opencv/archive/2.4.9.zip
unzip opencv-2.4.9.zip 
cd  opencv-2.4.9
mkdir build
cd build/
编译
cmake -D WITH_TBB=ON -D WITH_EIGEN=ON ..    
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local .. 
make 
make install
编译opencv的java版本
yum install ant
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -DBUILD_TESTS=OFF ..
make -j8
make install
最后拷贝文件
此时可以找到 /data/software/opencv-2.4.9/build/lib/libopencv_java249.so
拷贝到/Jdk1.8/jdk1.8/jre/bin/中
最后java启动jar包的时候带上环境
nohup java -Djava.library.path=/Jdk1.8/jdk1.8/jre/bin/  -jar transcode.jar > transcode.out &