This chapter discusses some high level and highly-visible changes from the Java 1.4.1 release of Java for Mac OS X to the Java 1.4.2 release.
How and Where to Get Java 1.4.2
Java 1.4.2 Replaces Java 1.4.1
New LiveConnect Support
New JFileChooser Dialogs
New ColorSync CMMs
AWT Enhancements
Proxy Server Enhancements
Java 1.4.2 is available only for Mac OS X version 10.3 (Panther). It is not available for earlier versions of Mac OS X. There are two parts to the Java 1.4.2 release for Mac OS X, the user and developer packages. The user package is available through Mac OS X’s Software Update and online at http://www.apple.com/downloads/macosx/. People that use Software Update will see this as a recommended update.
Apple does not provide a redistribution license for Java 1.4.2. Your customers need to download it directly from Apple’s site.
The developer package is an optional update available from http://connect.apple.com. It includes updated developer examples, tools, project templates, and Javadoc API references for both Sun’s and Apple’s classes. Although optional, this is a recommended update for anyone doing Java development for Mac OS X.
It is important to recognize that with the installation of Java 1.4.2, Java 1.4.1 is no longer available. Java 1.4.2 replaces Java 1.4.1. If you have hard-coded any dependencies to Java 1.4.1, make sure to test your code on Mac OS X with Java 1.4.2.
If you have wrapped your Java application as a native Mac OS X application bundle, verify that you are using the proper Java version string in your Info.plist file. Because Mac OS X still includes Java 1.3.1 it is important that you specify the correct version of Java for your application to run in. Table 1-1 shows the valid values for the Java version key and indicates the result of using that value.
String |
Java version used |
Notes |
---|---|---|
1.3.1 |
1.3.1 |
Specifies an exact version of Java. It is not recommended that you use this key unless absolutely necessary. |
1.3* |
1.3.1 |
Requests the highest version of Java 1.3 available. Note that if Java 1.3 is updated in future releases of Mac OS X, the latest version of Java 1.3 will be used. |
1.3+ |
1.4.2 |
Requests the highest version of Java above 1.3. Note that if Java is updated in future releases of Mac OS X, the latest version of Java will be used. |
1.4.1 |
1.4.2 |
With Java 1.4.2 is installed, Java 1.4.1 is no longer available. For compatibility, applications that specify 1.4.1 will run in Java 1.4.2. You should update these applications to specify 1.4* or 1.4+ as appropriate since the designation of a specific version has been deprecated. |
1.4* |
1.4.2 |
Specifies the highest version of the Java 1.4 available. Note that if Java 1.4 is updated in future releases of Mac OS X, the latest version of Java 1.4 will be used. |
1.4+ |
1.4.2 |
Specifies the highest version of Java above 1.4. Note that if Java is updated in future releases of Mac OS X, the latest version of Java will be used. |
Important: Don’t specify a specific version of the VM to use unless absolutely necessary. It is much safer to use either a star (*) or a plus (+) sign to indicate a version family rather than a specific version.
Java 1.4.2 brings support for a subset of LiveConnect functionality to Safari. Safari, version 1.2 or greater, can now allow JavaScript on a web page to interact with Java applets and for Java applets to interact with JavaScript. Other features associated with LiveConnect, such as the ability for JavaScript to interact with arbitrary Java classes, are not supported in this release.
JFileChooser dialogs in Mac OS X have never looked very much like their native counterparts. With the Java 1.4.2 release, JFileChoosers have been updated so that, while they still retain full Java functionality, they now integrate more cleanly with native file chooser dialogs. Figure 1-1 and Figure 1-2 illustrate the old and new dialogs respectively. Keep in mind that the AWT file chooser provides the best native experience in Mac OS X. Unless you absolutely need to use the Swing file chooser, try to use the AWT file chooser (FileDialog).
In Java 1.4.1 for Mac OS X, the java.awt.color native code was implemented using the KodakCMM codebase. While this is still the default ICC_ColorSpace implementation, with Java 1.4.2 you may also take advantage of a ColorSync implementation. Using ColorSync is especially useful if you want to take advantage of ColorSync profiles Mac OS X users may already be using in their existing workflow. If you are more concerned about cross platform compatibility, you should probably use the default Kodak CMM.Enable the ColorSync implementation with the apple.cmm.usecolorsync
system property. For example, to enable it from the command line you could pass the following flag to java
:
-Dapple.cmm.usecolorsync=true |
Many AWT enhancements have been included with this release. In general, your users should see increased AWT robustness and faster AWT startup times.
Several issues were raised with Java proxy server support with Java 1.4.1 in Mac OS X. The Java 1.4.2 has incorporated the following specific improvements:
FTP and SOCKS connections now properly respect the systems proxy exception list.
The operating system’s HTTPS proxy server is now used correctly by Java applications.
Java applications now use the operating system’s proxy exception list like native applications.
In general, proxy support is much more integrated with the operating system’s proxy support and Java applications should respect the settings in the Proxies pane of Network Preferences.
© 2004 Apple Computer, Inc. All Rights Reserved. (Last updated: 2004-08-11)