Install opencv for java on ubuntu

official guidance

  • reference
  • dependencies: cmake, apache ant
  • install cmake-gui for cmake GUI

add lib into IDE

  • official guide is for Eclipse
  • for Interlock Idea, manually adding lib and jar in the project structure setting

Problems encountered

the `opencv-3.4.1/build/lib/` may disable stack guard of Java HotSpot VM

  • SOLVING by: install `execstack` and doing
sudo execstack -c opencv-3.4.1/build/lib/