Skip to content
Advertisement

OpenCV with Python and Java support using cmake command line

I am trying to install latest OpenCV from here: https://github.com/opencv/opencv on my Ubuntu 20.04.

I need python and java support. I have installed a lot of per-requisites and used this cmake command to configure the build using the command line:

JavaScript

The output was this:

JavaScript

I see that cmake finds my python 2 and python 3 versions, finds also my java JNI and ant, but I see that the java module is listed in the unavailable modules list:

Unavailable: cnn_3dobj java js julia matlab ovis python2 viz

I see also that Java Wrappers and Java tests are marked with NO: — Java wrappers: NO — Java tests: NO

Please advise what am I doing wrong and how to make cmake build my java module, and find java wrappers and build java tests?

Thank you in advance for your help!

Advertisement

Answer

Meanwhile I found the reason. The problem was this option: -DBUILD_opencv_world=ON When I removed it:

JavaScript

java was found successfuly and I got this nice output:

JavaScript

Please, can somebody explain me why this option blocks the java? And do I need this option to be ON?

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement