Closed vivekburman closed 1 month ago
Hello, I'm not macOS user so this is only advice. I'm sorry.
Install steps in this site are here. I read you had done step 2 and step 3.
brew install ant
brew edit opencv
and update -DBUILD_opencv_java=ON
from OFF
brew install --build-from-source opencv
Maybe it is ok, but please could you confirm your system has installed ant
?
If it is OK, could you get CMake output ?
-- General configuration for OpenCV 4.9.0-dev =====================================
-- Version control: 4.9.0-455-XXXXXXXX
--
:
:
--
-- Java:
-- ant: /usr/local/bin/ant (ver 1.10.12)
-- Java: NO
-- JNI: /usr/local/include /usr/local/include /usr/local/include
-- Java wrappers: YES (ANT)
-- Java tests: YES
--
OpenCV 4.x document seems to be slightly old...
Yes, I've installed ant using 'brew install ant' its version: 1.10.14
How do I get the CMake output
As first I said I have no macOS. So if it is incorrect, I'm sorry.
brew install --build-from-source opencv
.version_string.tmp
in your work folder, ,/bin/opencv_version -v
comand.Here is the log file attached output.txt
Thank you for getting log.
It seems that -DBUILD_opencv_java
is not updated from OFF
to ON
.
This log has 4 "cmake -S" lines.
With only this result, it seems opencv.rb
is not updated.
Please could you confirm that is opencv.rb
updated ?
(Simplest way is run brew edit opencv
again.)
And I confirm OpenCV modules section.
Java module is "Disabled", not "Disabled by dependency". It means the reason of disabled Java module is NOT related with dependency (ant).
-- OpenCV modules:
-- To be built: alphamat aruco bgsegm bioinspired calib3d ccalib core d
-- Disabled: hdf java world
-- Disabled by dependency: -
-- Unavailable: cannops cudaarithm cudabgsegm cudacodec cudafeatures2d
-- Applications: apps
-- Documentation: NO
-- Non-free algorithms: YES
Hi, I was able to successfully get the build following this article: https://stackoverflow.com/questions/76097556/homebrew-on-mac-not-using-the-edited-opencv-rb-file-via-brew-edit-opencv-during.
Getting opencv-490.jar file successfully.
But the build is showing up on Java 21 although Java is set to 11 on my Mac, attaching the logs here. I tried setting the Java Home before running the process but no luck. output (4).txt
the error is: class file has wrong version 65.0, should be 55.0 for file Imgcodecs.class
Note: I need it to be on Java 11
OK, however this seems that question about your setting/environment, not OpenCV issue. Please could you close this issue and ask at Q&A forum ( https://forum.opencv.org/ ) ?
OpenCV - 4.9.x (Latest) MacOS - Ventura 13.6.4 ant: 1.10.14
I'm trying to install opencv with Java bindings on MacOS Intel. I'm following the steps from: https://opencv-java-tutorials.readthedocs.io/en/latest/01-installing-opencv-for-java.html#install-opencv-3-x-under-macos
As per the docs, changing this option to ON -DBUILD_opencv_java=OFF in -DBUILD_opencv_java=ON. Should do the job, but when I run "brew install --build-from-source opencv --verbose" in verbose mode it still takes it as OFF. Below is the screenshot
Here the screenshot of opencv file: