Using JavaNativeFoundation.framework with embedded OpenJDK7?

Mike Swingler swingler at apple.com
Thu Nov 3 10:13:05 PDT 2011


On Nov 3, 2011, at 12:29 AM, Tobias Bley (UltraMixer) wrote:

> Two more questions:
> 
> 1. You say "OpenJDK relies on JNF": Does it mean OpenJDK requires the  /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaNativeFoundation.framework and it doesn't work without it?

That is correct.

> 2. Why don't you build JNF as "standalone" framework which everbody can include in his Java Application (like Sparkle do)? Or why don't you make a dynamic library for inclusion instead of the current sub framework?

We needed JNF back in 2008 back when we started thinking about how to externalize the helper classes and macros we used in the JDK and related projects. Once it was formally a system framework, it became available for everyone to use. It had not occurred to us that there was a benefit to applications having their own private copy.

> Mike, so currently there is no chance to use your JavaNativeFoundation helper classes to build Java Applications uses a bundle OpenJDK jre (for submission in AppStore)?

Why not? You shouldn't have any problems by just using the built-in system one. It's system API, just like Foundation and AppKit. The only restriction is instantiating a JVM which is provided by Apple, so as long as you bundle your own, it should work fine.

> Best regards,
> Tobi
> 
> 
> 
> Am 02.11.2011 um 18:56 schrieb Mike Swingler:
> 
>> On Nov 2, 2011, at 4:22 AM, Tobias Bley (UltraMixer) wrote:
>> 
>>> Hi Mike,
>>> 
>>> what's the best way to use your excellent JavaNativeFoundation.framework within a Java Application using a private copy of the OpenJDK7? It wrote a jnilib for accessing Cocoa components but my problem is that this library is linked to /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaNativeFoundation.framework.
>>> 
>>> So how can I remove this static linking but using JNF?
>> 
>> JavaNativeFoundation is only present in /System/Library/Frameworks/JavaVM.framework/Frameworks. There is no private copy in OpenJDK, and OpenJDK itself relies on the version in /System. It's full and proper Mac OS X API - so I'd say don't worry about it. :-)

Regards,
Mike Swingler
Java Engineering
Apple Inc.



More information about the macosx-port-dev mailing list