Need to find jni.h in cmake on Mac
- by Ilan Tal
I am trying to make VTK compile on a Mac Air machine. I am using CMake 2.8-9, using Xcode4 as the generator. If I press the Configure button with VTK_WRAP_JAVA not checked, it will go with no errors. However I definitely need to use the wrap java since my main program is in Java and I need to get to VTK which is c++.
As soon as I check the wrap Java, I get Could NOT find JNI. It apparently is looking for jni.h which in Linux there is no problem finding, but in the Mac it apparently can't find it.
I did a locate jni.h and got
new-host-2:~ geraldkolodny$ locate jni.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/jni.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/jni.h
/Library/Java/JavaVirtualMachines/jdk1.7.0_07.jdk/Contents/Home/include/jni.h
I tried to manually put into JAVA_INCLUDE_PATH2 either entry 2 or 3 (without the jni.h at the end), but it still can't find jni.h.
Xcode used to have a template for jni but that is now gone in the latest version. I am fresh out of ideas on how to solve this problem. I'd be grateful for any suggestions.
Thanks, Ilan