The Java 1.4.1 release includes a complete reworking of how Java is implemented for Mac OS X. This release is more than just an update from the Java 1.3.1 classes to the Java 1.4.1 classes. It is more integrated with both the Java Software Development Kit and the core operating system than the Java 1.3.1 implementation. Apple has been able to bring Java 1.4.1 to Mac OS X using about two-thirds less native classes than the 1.3.1 implementation required. With less platform-specific code to maintain, Apple is in a position to more quickly and decisively respond to Java bugs and to provide a cleaner and more integrated Java experience on Mac OS X for you as a developer.
Overview of Changes
Specific Changes From Java 1.3.1 to 1.4.1
Before developing with Java 1.4.1 on Mac OS X, it is important to note a few basic details:
The Java version is 1.4.1_01.
The Java 1.4.1 runtime environment requires Mac OS X version 10.2.3 or later.
Java 1.4.1 is not included as a part of Mac OS X by default. If you are writing Java 1.4.1 applications remember that users will need to download Java 1.4.1 from Apple before they can use your application. They may do this through the Software Update pane of System Preferences or manually from http://www.apple.com/downloads/macosx/. Apple does not provide redistribution licenses for the Java 1.4.1 implementation.
The Java 1.4.1 Developer Package requires the December 2002 version of the Mac OS X Developer Tools to be installed. Both the Java 1.4.1 Developer Package and the December 2002 Mac OS X Developer Tools are available online at http://connect.apple.com.
The restructuring of the Java implementation has resulted in many changes that are not directly visible to you as a developer. However, there are a few key areas to be aware of:
This release of Java is installed in addition to the Java 1.3.1 release of Java already included with Mac OS X version 10.2. For the first time, Mac OS X supports two different Java environments, Java 1.3.1 and Java 1.4.1. This change may affect your Java applications deployed on the Mac OS X platform. “Chapter 3, Multiple Versions of Java,” discusses this issue in more detail.
With the change from 1.3.1 to 1.4.1 and the underlying architectural changes, the runtime system properties available to you have changed also. These changes are outlined in detail in “Chapter 4, Runtime System Properties,.”
For Java 1.3.1, AWT and Swing were implemented through the Mac OS X Carbon API. In Java 1.4.1 these implementations have made the transition to the Cocoa API. This change brings a true multithreaded environment and enhancements to the Aqua look and feel. As a Java developer, you don’t need to do anything different to take advantage of these benefits. If though, you rely on native code for any aspects of your Java applications, the change from Carbon to Cocoa will probably affect how you access native code and what native code is most readily available to you. Java 1.4.1 Development for Mac OS X provides more details on this topic.
Browser-based applet support has been improved to provide much smoother and more reliable performance. This includes Java 1.4.1 support from Apple’s Safari browser.
Native support for the Java Accessibility API is provided by default in AWT. There is no need for you to provide a bridge to native code to make your applications accessible. Users of assistive technologies that have configured the Universal Access system preferences will automatically be able to use your Java application with those technologies. Swing Accessibility is not fully implemented.
Native support for the security features is provided through the Mac OS X Secure Transport API. This allows users to manage certificates through their Keychain and the Keychain Access application.
AppleScript support is available for Java applications through two mechanisms. Basic Apple Events are supported through implementing the handlers in com.apple.eawt.ApplicationListener
. Additional user interface scripting can be done by using the AppleScript UI Element Scripting plug-in available with the December 2002 Mac OS X Developer Tools.
Jar Bundler, a new application for bundling Java applications as Mac OS X applications, is included. It replaces MRJAppBuilder, which is no longer supported.
Two versions of the Java Plugin Settings application are now provided. These are installed in /Applications/Utilities/Java
. One version allows you to access settings for the Java Plug-in 1.3.1 used by Internet Explorer and most other browsers. The other allows you to access settings for the Java 1.4.1 Plug-in used by Safari.
In Java 1.3.1 in Mac OS X, the ICC_ColorSpace implementation is based on Apple's ColorSync technology. In Java 1.4.1, this is replaced with Sun's implementation. This change fixes compatibility issues when dealing with color profiles in Java on other platforms.
The com.apple.mrj
packages have been deprecated. New classes that provide some of the same functionality have been included in the com.apple.eio
and com.apple.eawt
packages. These are documented in the Java 1.4.1 API Reference: Apple Extensions.
With Java 1.3.1, you could explicitly specify Java 2D graphics hardware acceleration. With Java 1.4.1, hardware acceleration is handled by the Mac OS X Quartz Extreme graphics engine with no need for developer intervention.
JDirect is not supported in Java 1.4.1. However, it still works as a part of Java 1.3.1.
QuickTime for Java is not supported in Java 1.4.1. However, it still works as a part of Java 1.3.1.
© 2003 Apple Computer, Inc. All Rights Reserved. (Last updated: 2003-06-11)