Probably you forgot to specify --with-java parameter
brew tap homebrew/science
brew install opencv --with-java
After compiling a jar file is in the path
/usr/local/Cellar/opencv/2.4.9/share/OpenCV/java/opencv-249.jar
Question
After installing opencv 2.4.8.2 with homebrew, I can't seem to find the jar file in /usr/local/Cellar/opencv/2.4.8.2/share/OpenCV
I'm using Mavericks, any ideas?
Solution
Probably you forgot to specify --with-java parameter
brew tap homebrew/science
brew install opencv --with-java
After compiling a jar file is in the path
/usr/local/Cellar/opencv/2.4.9/share/OpenCV/java/opencv-249.jar
OTHER TIPS
I solved the question by installing ant (and the other dependencies of opencv) using homebrew and then using cmake to install opencv instead of homebrew. I downloaded opencv from the website then used the following commands:
cd opencv-2.4.8/
mkdir build
cd build/
cmake -DBUILD_SHARED_LIBS=OFF ..
cmake -G "Unix Makefiles" ..
make -j8
The jar will pop out in the following directory:
opencv-2.4.8/build/bin/opencv-248.jar
I had this issue and tried with the --with-java
option and it didn't work.
I had to edit the formula (brew edit opencv3
) and insert this options myself:
option "with-contrib", "With contrib"
option "with-java", "With java"
Just above the dependency declarations.
You will also have to ensure that -DBUILD_opencv_java=ON
is in your args
. Note that the value is set to ON
not OFF
After you've done this. Uninstall opencv then install it again.
The error could just be because -DBUILD_opencv_java
is not enabled. Enable it using brew edit opencv3