Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

[Java for Mac OS X 10.6 Update 3] jni.h link (and others) missing ?

Hello,

I've recently upgraded my Java for Mac to build 1.6.0_22-b04-307-10M3261.
When trying to re-compile a C/C++ project requiring jni.h (which was compiling correctly before the upgrade), I now get this compile error: "error: jni.h: No such file or directory"

When browsing for the file, I noticed it is still "virtually" located where it used to be, i.e. "System/Library/Frameworks/JavaVM.framework/Headers/jni.h", yet this jni.h is only an alias that points nowhere anymore. Same symptom for almost all other ".h" files in this folder. What is happening ? Is JNI dying on Mac OS ? This worries me quite a lot, as I work on several projects using JNI and which will loose compatibility on Mac.

On a related matter (but is this really due to update 3?), I've noticed some refactoring in the Java installation (some of the Java stuff seems to have been moved to the "/System/Library/Java/JavaVirtualMachines" folder in the form of a ".bundle" file). Is this new ? If so, is this related to the problem above ?

If the solution is somewhat related to the probable Oracle takeover on Java support, is it possible in the meantime to downgrade Java back to update 2 to get my "jni.h" back in place ?

Thanks in advance for your help !

Mac Pro, Mac OS X (10.6.4), 2 x 2.8GHz / 10 Go

Posted on Oct 29, 2010 8:19 AM

Reply
Question marked as Best reply

Posted on Oct 31, 2010 12:30 PM

The release notes <http://developer.apple.com/library/mac/#releasenotes/Java/JavaSnowLeopardUpdat e3LeopardUpdate8RN/Introduction/Introduction.html> says "If you do JNI development, you must install the Java Developer package, since it contains updated headers for the native JavaVM.framework and its sub-frameworks (8421130). The Java Developer package is available from http://connect.apple.com."

I just ran the installer and it did replace the broken sym-links with real files which allowed our build to succeed.
5 replies
Question marked as Best reply

Oct 31, 2010 12:30 PM in response to daft alx

The release notes <http://developer.apple.com/library/mac/#releasenotes/Java/JavaSnowLeopardUpdat e3LeopardUpdate8RN/Introduction/Introduction.html> says "If you do JNI development, you must install the Java Developer package, since it contains updated headers for the native JavaVM.framework and its sub-frameworks (8421130). The Java Developer package is available from http://connect.apple.com."

I just ran the installer and it did replace the broken sym-links with real files which allowed our build to succeed.

Nov 21, 2010 7:08 AM in response to daft alx

Thanks for the note about the Java Developer package Per. I find that after installation of this, there's still a missing symlink to the include files.

Namely, /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/include does not exist (The Maven NAR Plugin uses this in its -I include path).

To kludge my system to get my build working again, I did:
$ cd /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
$ sudo ln -s /System/Library/Frameworks/JavaVM.framework/Headers include

[Java for Mac OS X 10.6 Update 3] jni.h link (and others) missing ?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.