Skip to content

install opencv on centos for java

I’m trying to install opencv on my centos 8 server to be used by java program. I followed the instructions here. after configuring opencv, I get the following result:

--   Java:
--     ant:                         NO
--     JNI:                         /usr/lib/jvm/java/include/usr/lib/jvm/java/include/linux/usr/lib/jvm/java/include
--     Java wrappers:               NO
--     Java tests:                  NO

I have already installed java on my server (by using sudo dnf install java-11-openjdk-devel, but I have not installed ant). in order to make opencv ready to be used by java, should ant and Java wrappers show YES? and how to correct my configurations in this case?



You need to install ANT and add it to the system path, which is used when building Java wrapper, and also set the OpenCV build_shared_libs = OFF, otherwise, the Java wrapper will not work.

10 People found this is helpful