Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Java 7 use Apple Java Extensions?

Tags:

macos

java-7

In order to help Java apps look more like native apps when run on Mac OS X, Apple created the Apple Java Extensions in order to make Java apps behave more like Mac OS X. These allow for things like handling the behavior of the "About" menu and supporting drag and drop onto the application icon.

However, I can't find anything indicating whether or not these extensions are included with Java 7 or even usable with Java 7. It is my understanding that Apple merged their OS X implementation into OpenJDK, but I'm not sure whether these extensions went with it. I do see that the goal for the Mac OS X port of OpenJDK aims to "Include a complete, native Cocoa-based UI Toolkit", but I can't find much about what this entails. Searching the web has not proved very fruitful and I have no idea about if they are compatible with Java 7 or are even included.

So I guess I have three questions:

  • Will a Mac running Java 7 be able to use the Apple Java Extensions?
  • Are they included in Java 7, and if not, can I download them to bundle into my app?
  • Are there any alternatives to these extensions that are Java 7 compatible?
like image 820
Thunderforge Avatar asked Feb 24 '13 03:02

Thunderforge


1 Answers

Will a Mac running Java 7 be able to use the Apple Java Extensions?

Yes. They are included both in the Oracle distribution and in OpenJDK. See the second answer here below.

I can't vouch for the complete API as I only need a subset to support drag-drop behaviour on the app icon and on the app frame. I can confirm though this works as expected with OpenJDK 7. No problems on the distribution side either, as the app is on sale on the Mac App Store.

Are they included in Java 7, and if not, can I download them to bundle into my app?

They are included in OpenJDK 7, you can find the sources in /src/macosx/classes/com/apple and supported by Oracle as hinted by the messages and bug fixes readable on the macosx-port-dev mailing list.

They are also included in the Oracle distribution, unjar rt.jar to see them.

You don't have to download anything, just start using them in your editor:

IntelliJ completion

Are there any alternatives to these extensions that are Java 7 compatible?

Not that I know of, but I doubt you need an alternative.

like image 125
Trasplazio Garzuglio Avatar answered Sep 30 '22 03:09

Trasplazio Garzuglio