Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

JNI Lib Location when Loading from Java Applet on OS 10.2



> From: Noa Yissar <email@hidden>
> I tried doing all the workarounds with the path
> location and supplying the full path in the
> System.loadLibrary() call and it still doesn't work.

I have had some success by installing my JAR file in
"/Library/Java/Extensions" and my native code in "/lib".

But if the Applet is not signed then the code in the JAR file cannot just
load the native library without a little trick. This code tells the
SecurityManager to allow a priveledged operation even though the Applet is
not signed.

import java.security.*;

private static void loadLibraryPriveledged()
{
Boolean result = (Boolean) AccessController.doPrivileged(new
PrivilegedAction()
{
public Object run()
{
System.loadLibrary(libName);
return null;
}
}
);
}


Phil Burk
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.