Build OpenCV3.4.1 from source on Ubuntu 16.04, but failed to generate Java bindings
I am trying to build OpenCV from source on Ubuntu to within a Java application, but when during processing make command, when it reaches to generate Java bindings it fails with the following error:
> [ 90%] Generate files for Java
> bindings Traceback (most recent call
> last): File
> "/home/adil/Desktop/opencv/opencv/modules/java/generator/../generator/gen_java.py",
> line 1093, in
> copy_java_files(java_files_dir,
> target_path) File
> "/home/adil/Desktop/opencv/opencv/modules/java/generator/../generator/gen_java.py",
> line 1042, in copy_java_files
> package_path = 'org/opencv/' + module
> NameError: global name 'module' is not
> defined
> modules/java_bindings_generator/CMakeFiles/gen_opencv_java_source.dir/build.make:430:
> recipe for target
> 'CMakeFiles/dephelper/gen_opencv_java_source'
> failed make[2]: *
> [CMakeFiles/dephelper/gen_opencv_java_source]
> Error 1 CMakeFiles/Makefile2:2799:
> recipe for target
> 'modules/java_bindings_generator/CMakeFiles/gen_opencv_java_source.dir/all'
> failed make[1]: *
> [modules/java_bindings_generator/CMakeFiles/gen_opencv_java_source.dir/all]
> Error 2 Makefile:160: recipe for
> target 'all' failed make: *** [all]
> Error 2
I have installed every possible lib suggested on the Google and OpenCV website, nothing was solved the problem.
So what causes this error, and how solve?
Note: I have Java-9 installed on my machine.
opencv version ?
the generator script tried to copy files to
build/modules/java_bindings_generator/gen/java/org/opencv
but it couldn't. find out why.
OpenCV is the latest version 3.4.1
and your python, cmake ?
there * is* something weird going on here , and indeed,
module
is not definedPython is 3.5.2 and Python 2.7.12, Cmake is 3.10.2. I have tried every possible and the latest needed libs, but I don't know why it says cannot find this or that.