< Previous PageNext Page > Hide TOC

New Features

This chapter details significant improvements present in J2SE 5.0 Release 1 for Mac OS X.

In this section:

Java Applets
Java Printing
Java Versioning


Java Applets

Radar #4066779

Cocoa Java Plugin Public API

Description:

Previously, there was no public API for using the Java Plugin in a Cocoa application.

Resolution:

There is a new Cocoa Java Plugin public API. This API can be used to embed Java into your Cocoa application. It’s documented in:

/System/Library/Frameworks/WebKit.framework/Headers/WebJavaPlugIn.h
/System/Library/Frameworks/WebKit.framework/Headers/WebPlugin.h
/System/Library/Frameworks/WebKit.framework/Headers/WebPluginContainer.h
/System/Library/Frameworks/WebKit.framework/Headers/ WebPluginViewFactory.h

Documentation for the behavior of plug-ins can be found in WebKit Plug-In Programming Topics.

Java Printing

Radar #4035773

javax.print Support

Description:

Previous Java releases for Mac OS X didn't support the javax.print package.

Resolution:

J2SE 5.0 Release 1 supports javax.print via Mac OS X's CUPS implementation.

Java Versioning

Radar #4030615

The current JDK and JRE after installing J2SE 5.0 Release 1

Description:

Java 1.4.2 remains the current JDK and JRE after installing J2SE 5.0 Release 1.

Resolution:

This allows applications built for Java 1.4.2 to continue running in Java 1.4.2.

To use the J2SE 5.0 version of any command-line Java utility, such as java or javac, specify the full path to the J2SE 5.0 version of the command. This usually means prepending the command with the path /System/Library/Frameworks/JavaVM.framework/Versions/1.5/.

The JVMVersion Info.plist key allows you to specify which JVM your application uses. Using either the 1.3+, 1.4+, or 1.5+ keys results in the VM being used according to a precedence list set in the Java Application Settings portion of the Java Preferences application, found in /Applications/Utilities/Java/J2SE 5.0. By default in J2SE 5.0 Release 1, the precedence list follows this order:

J2SE 1.4.2
J2SE 5.0

Though not listed, Java 1.3.1 is considered to be the last entry on the list.

This works by trying to match the given key versus VM versions in the list:

Table 1-1 lists the possible combinations of values when working with JVMVersion values and the Java Version Precedence List found in Java Preferences.

Table 1-1  Java VM behavior, based on the JVMVersion key and the Java Version Precedence List in Java Preferences

Possible JVMVersion Value

VM used if “J2SE 1.4.2” is listed first in Java Version Precedence List (Default)

VM used if “J2SE 5.0” is listed first in Java Version Precedence List

1.5+ (5.0 or “higher”)

J2SE 5.0

J2SE 5.0

1.5* (newest 5.0)

J2SE 5.0

J2SE 5.0

1.4+ (1.4 or “higher”)

J2SE 1.4.2

J2SE 5.0

1.4* (newest 1.4)

J2SE 1.4.2

J2SE 1.4.2

1.3+ (1.3 or “higher”)

J2SE 1.4.2

J2SE 5.0

1.3* (newest 1.3)

Java 1.3.1

Java 1.3.1

You can specify a specific version of Java as your JVMVersion key (such as 1.4.2 or 1.5.0), but if that precise version is not installed on the system, your application will fail to launch. This is not recommended.

To use an applet in Safari using J2SE 5.0, use the Applet portion of the Java Preferences application, found in /Applications/Utilities/Java/J2SE 5.0, to select J2SE 5.0 as the virtual machine for applets.

For information on configuring Xcode projects for use with J2SE 5.0, read “Radar #4090917.”



< Previous PageNext Page > Hide TOC


© 2005 Apple Computer, Inc. All Rights Reserved. (Last updated: 2005-10-04)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.