Search code examples
javaopencvanthomebrew

Set target java version when build OpenCV with brew


I'm using brew to build OpenCV with java support following this tutorial. After built successful I got the error class file has wrong version 57.0, should be 52.0 when using. I'm using OpenJDK 8, how can I target the build to this version. Thank you.


Solution

  • Found the answer, put the extra -DOPENCV_JAVA_TARGET_VERSION=1.8 args to cmake in brew formula.