New and Noteworthy
This chapter lists high-profile features in these releases.
Java Deprecation
As of the release of Java for Mac OS X 10.6 Update 3, the Java runtime ported by Apple and that ships with Mac OS X is deprecated. Developers should not rely on the Apple-supplied Java runtime being present in future versions of Mac OS X.
The Java runtime shipping in Mac OS X 10.6 Snow Leopard, and Mac OS X 10.5 Leopard, will continue to be supported and maintained through the standard support cycles of those products.
Third Party JVM Support and Locations
Java Preferences now shows all discovered JVMs in a single list in the General tab. This list shows the name, vendor, architecture, and full version of each JVM (8146434). It also coalesces multiple versions of the same major platform version from the same vendor and architecture into the same line. Clicking on the version at the end of the line shows a popup menu which chooses between these multiple versions.
Java SE 6 Locations
The location of the Java SE 6 runtime home has changed to
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
. JDK bundles provided via the Developer package, developer previews, and 3rd party JVMs should be installed in/Library/Java/JavaVirtualMachines
or ~/Library/Java/JavaVirtualMachines
. Developer previews of Java can now be installed and uninstalled without affecting the system JVM(s).Java IDEs
In testing, some Java IDEs have shown problems navigating into the new JDK bundle structure, and persisting the location of the new JDK bundles. Some IDEs may have to change how they prompt users to locate a JVM on Mac OS X, and should ideally present a list of JVMs generated from
/usr/libexec/java_home --xml
, which outputs each discovered JVM, and orders them according to the user's order in Java Preferences.Developer Package
The Java Developer package now supersedes the Java Documentation package (3672275). The developer package contains a copy of the Java SE 6 JDK bundle with all JavaDoc and source jars included inside of it. The Java Developer package also contains documentation for the Java tools in
/usr/share/java
, such as Ant, Maven, JUnit, and Derby. If you do JNI development, you must install the Java Developer package, since it contains updated headers for the native JavaVM.framework and its sub-frameworks (8421130). The Java Developer package is available from http://connect.apple.com.Redesigned eAWT
The
com.apple.eawt.Application
class has undergone a significant redesign of basic Mac event handling (4083709, 4623624, 4714211, 5445495, et al.). Most of the operations handled by ApplicationListeners are now processed by a single delegate handler:setAboutHandler(AboutHandler)
setPreferencesHandler(PreferencesHandler)
setQuitHandler(QuitHandler)
setOpenFileHandler(OpenFilesHandler)
setOpenURIHandler(OpenURIHandler)
setPrintFileHandler(PrintFilesHandler)
You can also register multiple listeners for each of these listeners with the
addAppEventListener(AppEventListener)
method:AppForegroundListener
AppHiddenListener
AppReOpenedListener
ScreenSleepListener
SystemSleepListener
UserSessionListener
The JavaDoc for all of the Apple Java extensions (including the eAWT) is present in the appledocs.jar file of the Developer .jdk bundle in
/Library/Java/JavaVirtualMachines
.Sudden Termination
Java applications on Mac OS X 10.6 can now opt-in to being suddenly terminated by the OS to speed log-out and shut down. Apps can raise and lower their sudden termination count with the
enableSuddenTermination()
anddisableSuddenTermination()
methods on the com.apple.eawt.Application
class. More information on Sudden Termination is available in NSProcessInfo Class Reference. (5756768)Default Quit Action
Applications can now request that the eAWT send WindowClosing events to all open windows instead of calling
System.exit(0)
when the user choose Quit from the application menu. By setting the apple.eawt.quitStrategy
system property to CLOSE_ALL_WINDOWS
, the eAWT will send a close event to every window in back-to-front order (3198576).