开发者

Apple deprecating Java. Will Apple-specific customizations still work with other JREs/JVMs?

Apple "deprecated" Java and will stop supporting it in the future.

Assuming that Oracle will take over support for Java on the Mac, is there a way to be sure that Apple-specific hacks like those "put the menubar at the top of the screen" or "use the native theme by default" will be supported the same way on other JREs/JVMs targeting Apple's platform?

Is there some industry standard or precedence how situations like 开发者_Python百科these are handled or is this an additional burden for the individual developer (== yet another runtime to test)?

Is it common practice to start from the perspective of the former implementation and replicate the bugs to behave like the Apple implementation? Or is it more likely that engineering will start from some "standard" Java like OpenJDK and will adapt it to the Mac OSX system introducing different bugs/APIs/settings to integrate into the native platform?

While the details of Apple's move and Oracle's reaction are still not clear, I would be very happy if someone with experience in "how big corporations behave in these situations" would step up and provide some insight.


It appears that Apple's contributions and customizations are being made available to both Oracle and the Java community. From an Apple press release dated November 12, 2010 titled Oracle and Apple Announce OpenJDK Project for Mac OS X:

Apple will contribute most of the key components, tools and technology required for a Java SE 7 implementation on Mac OS X, including a 32-bit and 64-bit HotSpot-based Java virtual machine, class libraries, a networking stack and the foundation for a new graphical client. OpenJDK will make Apple’s Java technology available to open source developers so they can access and contribute to the effort.

The announcement also claims that Oracle will be supporting OS X in future:

Apple also confirmed that Java SE 6 will continue to be available from Apple for Mac OS X Snow Leopard® and the upcoming release of Mac OS X Lion. Java SE 7 and future versions of Java for Mac OS X will be available from Oracle.


"use the native theme by default" is already possible in Oracle JVMs using the $JAVA_HOME/lib/swing.properties file (assuming $JAVA_HOME is an environment variable).

It should contain something like this:

# Swing properties
swing.defaultlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel

Note: This is the Nimbus L&F name, a new vector-based cross-platform UI present in Java 6u10.

I don't know what the Mac L&F name is in Apple's JVM, and it may have a different name in Oracle's Mac JVM when they make it.

Sadly, I don't know how to force it to native without explicitly specifying it.

As for whether other properties, such as the merge menubar property, will work in an Oracle OSX JVM, we won't know until Oracle actually makes one.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜