This problem returned me 2 days in a row, and at that moment I was very desperate. As stated in the description of the question, I need a 32-bit version of the OpenCV 2.4.11 Java library, which will work with JDK 1.6 on a Mac running Yosemite.
I need this because another library that I use requires 32 bits ( and this is only available in JDK 1.6 ). Therefore, I use JDK 1.6 and pass the VM argument -d32.
I had two main attempts:
For both attempts, I first set my default JDK to 6:
$nano .bash_profile
export JAVA_HOME=$(/usr/libexec/java_home -v 1.6)
(It should be noted that both methods below have no problems building a library with JDK 1.7 and 64 bits.)
Method 1: I am trying to create an OpenCV library using CMake:
I go to the directory where I saved the library
mkdir build
cd build
cmake -G "Unix Makefiles" -D CMAKE_OSX_ARCHITECTURES=i386 -D CMAKE_C_FLAGS=-m32 -D CMAKE_CXX_FLAGS=-m32 ..
( )
, Java:
-- Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
-- Java:
-- ant: /usr/local/bin/ant (ver 1.9.6)
-- JNI: NO
-- Java tests: NO
.
, CMake, . FindJNI.cmake .
2 OpenCV HomeBrew:
brew tap homebrew/science
brew install opencv --with-java --universal
. .jar .dylib OpenCV Eclipse , :
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/opencv/core/Point : Unsupported major.minor version 51.0
, JDK 1.6.
/:
- . ,
cmake homebrew,
"" . i. Git,
XCode ..
- JDK 1.5. , JDK Yosemite,
, .
- OpenCV. 2.4.10,
.