Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Linking libjava.jnilib on Mac OS 10.4

843829Nov 30 2005
I'm having a very simple problem and am unfortunately very new to
Mac, Java, and JNI.

I'm trying to compile a simple example I found from a Sun tutorial,
with a few tweaks for Mac OS 10.4.

The problem I'm having is that I can't link to libjava.jnilib.

g++ -I/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Headers/ -L/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Libraries/ -ljava invoke.cxx
/usr/bin/ld: can't locate file for: -ljava
collect2: ld returned 1 exit status
make: *** [default] Error 1

The library exists, but only as a .jnilib and not a .dylib.

$ ls -l /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Libraries/libjava.jnilib
-rwxr-xr-x 1 root wheel 318488 Nov 15 22:31 /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Libraries/libjava.jnilib

Any help would be greatly appreciated.
Thanks,
Alex.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 28 2005
Added on Nov 30 2005
0 comments
232 views