OS X Leopard JNI Link Error

02 Sep 2008

I just spent a long time tracking this down, and nobody else on google had ever reported a solution. So I’m posting this so the next person wit h this problem can find this post.

If you see this error when linking something in JNI:

$ gcc -dynamiclib -o libDirectorySyncer.jnilib target/c/dsync.o -framework JavaVM
ld: framework not found JavaVM

it’s because leopard has messed up your JDK folder:

$ ls -l /System/Library/Frameworks/JavaVM.framework/Versions/Current
/System/Library/Frameworks/JavaVM.framework/Versions/Current@ -> 1.6.0

Wrong! It needs to be pointing to “A”. No idea why.

$ cd /System/Library/Frameworks/JavaVM.framework/Versions/
$ sudo rm Current
$ sudo ln -s A Current

That will fix it. Yay!

« Back to article list

Please do not post this article to Hacker News.

Permission to scrape this site or any of its content, for any purpose, is denied, regardless of your personal beliefs or desire to design a novel opt-out method.