The Java API for XML processing has been added to the Java 2 Platform. J2SE 1.4.0 provides basic support for processing XML documents through a standardized set of APIs. For more information, see http://java.sun.com/j2se/1.4/docs/guide/xml/index.html.
The new I/O (NIO) API provides new features and improved performance in the areas of buffer management, character-set support, regular-expression matching, file I/O, and scalable network I/O. For more information, see http://java.sun.com/j2se/1.4/docs/guide/nio/index.html.
The JavaTM Cryptography Extension (JCE), JavaTM Secure Socket Extension (JSSE), and JavaTM Authentication and Authorization Service (JAAS) security features have now been integrated into J2SE v 1.4 rather than being optional packages.
There are two new security features:
The JavaTM GSS-API can be used for securely exchanging messages between communicating applications using the Kerberos V5 mechanism. For more information, see http://java.sun.com/j2se/1.4/docs/guide/security/jgss/tutorials/index.html.
The JavaTM Certification Path API includes new classes and methods in the java.security.cert package that allow you to build and validate certification paths (also known as "certificate chains"). For more information, see http://java.sun.com/j2se/1.4/docs/guide/security/certpath/CertPathProgGuide.html.
Due to import control restrictions, the JCE jurisdiction policy files shipped with the J2SE, v 1.4 allow "strong" but limited cryptography to be used. An "unlimited" version of these files indicating no restrictions on cryptographic strengths is available.
The JSSE implementation provided in this release includes the strong cipher suites. However, due to U.S. export control restrictions, it does not allow the default SSLSocketFactory and SSLServerSocketFactory to be replaced. For more information, please see the JSSE Reference Guide at http://java.sun.com/j2se/1.4/docs/guide/security/jsse/JSSERefGuide.html.
With the integration of JAAS into the J2SE, the java.security.Policy API handles Principal-based queries, and the default policy implementation supports Principal-based grant entries. Thus, access control can now be based not just on what code is running, but also on who is running it.
Support for dynamic policies has been added. In J2SE releases prior to version 1.4, classes were statically bound with permissions by querying security policy during class loading. The lifetime of this binding was scoped by the lifetime of the class loader. In version 1.4 this binding is now deferred until needed by a security check. The lifetime of the binding is now scoped by the lifetime of the security policy.
For more information on security in J2SE 1.4, see http://java.sun.com/j2se/1.4/docs/guide/security/index.html.
Java 2DTM technology includes many new features including performance improvements, support for hardware acceleration for offscreen images, a pluggable image I/O framework, a new print service API, and several new font features. For more information, see http://java.sun.com/j2se/1.4/docs/guide/2d/new_features.html.
The Java Image I/O Framework provides a pluggable architecture for working with images that are stored in files and accessed across the network. This framework offers substantially more flexibility and power than the pre-J2SE 1.4.0 APIs for loading and saving images. For more information, see http://java.sun.com/j2se/1.4/docs/guide/imageio/index.html.
The Java Print Service is a new Java Print API that enables client and server applications to:
Discover and select print services based on their capabilities
Specify the format of print data
Submit print jobs to services that support the document type to be printed.
For more information, see http://java.sun.com/j2se/1.4/docs/guide/jps/index.html.
Changes to the Abstract Window Toolkit (AWT) package center on improving the robustness, behavior, and performance of programs that present a graphical user interface. Improvements include the following:
A new focus architecture replaces the previous implementation and addresses many focus-related bugs that were caused by platform inconsistencies, and incompatibilities between AWT and Swing components.
The new full-screen exclusive mode API supports high-performance graphics by suspending the windowing system so that drawing can be rendered directly to the screen. This capacity benefits applications such as games, or other rendering-intensive applications.
Headless support is now enabled by new graphics environment methods that indicate whether a display, keyboard, and mouse can be supported in a graphics environment.
The ability to disable native frame decorations is now available for applications that need complete control of the specification of a frame's appearance. When enabled, it prevents the rendering of a native title bar, system menu, border, or other native screen components.
The mouse wheel, with a scroll wheel in place of the middle mouse button, is enabled with new built-in Java support for scrolling with the mouse wheel. Also, a new mouse wheel listener class allows customization of mouse wheel behavior.
The AWT package has been modified to be fully 64-bit compliant and now runs on Solaris machines with 64-bit and 32-bit addresses.
Many new features have been added to Swing:
The spinner component is a single line input field that enables the user to select a number or a value by cycling through a sequence of values with a tiny pair of up/down arrow buttons.
The new formatted text field component allows formatting of dates, numbers, and strings, such as a text field that accepts only decimal currency values.
A new drag-and-drop architecture provides seamless drag-and-drop support between components as well as an easy way to implement drag-and-drop in your customized Swing components. You need only to write a couple of methods that describe the particulars of your data model.
Several features have been enhanced in Swing:
The progress bar component has been enhanced to support an indeterminate state. Rather than showing the degree of completeness, the indeterminate progress bar uses constant animation to show that a time-consuming operation is occurring.
The tabbed pane component has been enhanced to support scrollable tabs. With this feature enabled, if all the tabs cannot fit within a single tab run, the tabbed pane component displays a single, scrollable run of tabs instead of wrapping the tabs onto multiple runs.
The popup and popup factory classes, which were previously package private, have been exposed and made public so that developers can customize or create their own popups.
The new focus architecture is fully integrated into Swing.
For more information, see http://java.sun.com/j2se/1.4/docs/guide/swing/SwingChanges.html.
Swing has added support for data transfer between applications. A drag and drop operation is a data transfer request that has been specified by a gesture with a graphical pointing device. In the case of copy/paste, data transfer is often initiated with the keyboard. The ability to transfer data takes two forms: Drag and drop support and clipboard transfer via cut/copy/paste. See http://java.sun.com/j2se/1.4/docs/guide/swing/1.4/dnd.html.
The Java Logging APIs facilitate software servicing and maintenance at customer sites by producing log reports suitable for analysis by end users, system administrators, field service engineers, and software development teams. The Logging APIs capture information such as security failures, configuration errors, performance bottlenecs, and bugs in the application or platform. For more information, see http://java.sun.com/j2se/1.4/docs/guide/util/logging/index.html.
The Java Web Start product is a new application-deployment technology that is bundled with J2SE 1.4.0. With Java Web Start, you launch applications simply by clicking on a Web page link. If the application is not present on your computer, Java Web Start automatically downloads all necessary files. It then caches the files on your computer so the application is always ready to be relaunched anytime you want -- either from an icon on your desktop or from the web-page link. For more information, see http://java.sun.com/j2se/1.4/docs/guide/jws/index.html.
The new persistence model is designed to handle the process of converting a graph of JavaBeans eans to and from a persistent form. The new API is suitable for creating archives of graphs of JavaBeans components as textual representations of their properties. For more information, see http://java.sun.com/j2se/1.4/docs/guide/beans/changes14.html.
The JDBCTM 3.0 API, which is composed of packages java.sql and javax.sql, provides universal data access from the Java programming language. By using the JDBC 3.0 API, you can access virtually any data source, from relational databases to spreadsheets and flat files. JDBC technology also provides a common base on which tools and alternative interfaces can be built.
This API enables you to do the following:
Set savepoints in a transaction
Keep result sets open after a transaction is committed
Reuse prepared statements
Get metadata about the parameters to a prepared statement
Retrieve keys that are automatically generated
Have multiple result sets open at one time
There are two new JDBC data types, BOOLEAN and DATALINK. The DATALINK type enables management of data outside of a data source. This release also establishes the relationship between the JDBC Service Provider Interface and the Connector architecture.
For more information, see http://java.sun.com/j2se/1.4/docs/guide/jdbc/index.html.
An assertion facility has been added to the Java 2 Platform. Assertions are boolean expressions that the programmer believes to be true concerning the state of a computer program. For example, after sorting a list, the programmer might assert that the list is in ascending order. Evaluating assertions at runtime to confirm their validity is one of the most powerful tools for improving code quality, as it quickly uncovers the programmer's misconceptions concerning a program's behavior. For more information, see “Assertion Facility” in Java 2 SDK for Solaris Developer's Guide.
This new feature a simple API for managing user preference and configuration data. Applications require preference and configuration data to adapt to different users, environments and needs. Applications need a way to store, retrieve, and modify this data. This need is met by the Preferences API. The Preferences API is intended to replace most common uses of class java.util.Properties, rectifying many of its deficiencies, while retaining its light weight. For more information, see http://java.sun.com/j2se/1.4/docs/guide/lang/preferences.html.
An endorsed standard is a Java API defined through a standards process other than the Java Community ProcessSM (JCPSM). Because endorsed standards are defined outside the JCP, it is anticipated that such standards may be revised between releases of the Java 2 Platform. In order to take advantage of new revisions to endorsed standards, developers and software vendors may use the Endorsed Standards Override Mechanism to provide newer versions of an endorsed standard than those included in the Java 2 Platform as released by Sun Microsystems. For full information on the Endorsed Standards Override Mechanism, see the documentation on the web at http://java.sun.com/j2se/1.4/docs/guide/standards/.
J2SE 1.4.0 for the Solaris Operating Environment, SPARC Platform Edition, supports 64-bit operation on 64-bit Sparc-v9 platforms when using the Java HotSpotTM Server VM. This allows support for heaps greater than 4 Gbytes, which is the absolute maximum that can be supported by a 32-bit VM. The Java HotSpot Server VM includes support for either 32-bit or 64-bit operation by using an appropriate command-line flag. When using the 64-bit VM a performance penalty of approximately 15% to 25% may be observed, depending on the amount of time your program spends accessing reference variables. J2SE 1.4.0 does not support 32-bit shared libraries, when running the 64-bit VM. Native (Java Native Interface) code must be recompiled in 64-bit mode.
The Java virtual machines in this release include several enhancements.
Signal-chaining facility.
64-bit support for 64-bit Sparc-v9 platforms.
Error-reporting mechanism.
New command-line option for performaing additional checks for Java Native Interface (JNI) functions.
New facility for logging garbage-collection events.
For more information, see http://java.sun.com/j2se/1.4/docs/guide/vm/index.html.
This release includes performance enhancements. For more information, see http://java.sun.com/j2se/1.4/docs/guide/performance/index.html.
New features include support for IPv6 in TCP- and UDP-based applications, and support for unconnected/unbound sockets, allowing more flexible socket creation, binding, and connection. A mechanism called Java Secure Socket Extension provides encryption for data sent via sockets, and a new class, URI, allows URI construction and parsing without the presence of a protocol handler. The FTP Protocol Handler has been overhauled for conformity to current standards. The default character set is now UTF8, and APIs have been added to enable other character schemes.
A new class, NetworkInterface, allows enumeration of interfaces and addresses, and JNDI DNS SP Support in InetAddress enables applications to configure a pure Java name service provider. TCP out-of-band data provides support for legacy applications; a UDP Connection function registers destination address with the OS, enabling asynchronous errors to be returned on the UDP socket; and full SOCkS V5 and V4 TCP support includes auto-negotiation with the proxy for which version to use. In addition, there are improvements to streaming, request and response headers processing, and error handling.
For more information, see http://java.sun.com/j2se/1.4/docs/guide/net/enhancements14.html.
The RMI runtime implementation will now preserve the server-side stack trace information of an exception that is thrown from a remote call, in addition to filling in the client-side stack trace as it did previous releases. Therefore, when such an exception becomes accessible to client code, its stack trace will now contain all of its original server-side trace data followed by the client-side trace.
In J2SE 1.4.0, certain static methods of java.rmi.server.RMIClassLoader delegate their behavior to an instance of a new service provider interface, java.rmi.server.RMIClassLoaderSpi. This service provider object can be configured to augment RMI's dynamic class-loading behavior for a given application. By default, the service provider implements the standard behavior of all of the static methods in RMIClassLoader.
The java.rmi.server.hostname property can now be dynamically updated to indicate that future exports should use a new host name. Therefore, the new host name value will be contained in the stub for an object that is exported after the property is updated.
For more information, see http://java.sun.com/j2se/1.4/docs/guide/rmi/relnotes.html.
This release has several changes and enhancements to the serialization API, including
Support for deserialization of objects that are known to be unshared in the data-serialization stream.
Support for a class-defined readObjectNoData method.
Important bug fixes.
For more information, see http://java.sun.com/j2se/1.4/docs/guide/serialization/relnotes14.html.
Java Naming and Directory InterfaceTM (JNDI) has the following enhancements in J2SE 1.4.0:
An Internet Domain Naming System (DNS) service provider is part of J2SE 1.4.0. This component enables applications to read data that is stored in the DNS.
The JNDI Lightweight Directory Access Protocol (LDAP) service provider has security enhancements that enable applications to establish secure sessions over existing LDAP connections and to use different authentication protocols.
The JNDI CORBA Object Services (COS) naming service provider supports the Interoperable Naming Service (INS) specification (99-12-03).
For more information, see http://java.sun.com/j2se/1.4/docs/guide/jndi/index.html#14changes.
The ORB shipping as part of Java 2 Platform now includes a Portable Object Adapter (POA) functionality. An ORB makes it possible for client(s) to make method invocations on the objects being supported by server(s) executing on the same or different machine(s). The POA functionality allows programmers to construct object implementations that are portable between different ORB products, provide support for objects with persistent identities, and much more. Other new features include Portable Interceptors, Interoperable Naming Service, GIOP 1.2 support, Dynamic Management of Any values, and new tools that support a persistent naming service and other features.
To learn more about the changes in Java IDL between J2SE v.1.3 and J2SE v.1.4, see http://java.sun.com/j2se/1.4/docs/guide/idl/jidlChanges.html. For general information, see http://java.sun.com/j2se/1.4/docs/guide/idl/index.html.
J2SE 1.4.0 includes an enhanced Java Platform Debugger Architecture that has the following new features.
The Java HotSpotTM virtual machine now uses "full-speed debugging". In the previous version of Java HotSpot, when debugging was enabled, the program executed using only the interpreter. Now, the full performance advantage of Java HotSpot technology is available to programs running with debugging enabled. The improved performance allows long running programs to be more easily debugged. It also allows testing to proceed at full speed and the launch of a debugger to occur on an exception.
A HotSwap feature has been added to allow a class to be updated while under the control of a debugger.
EventRequests now have the capability of specifying an instance filter, which restricts the events generated by the request to those in which the currently executing instance is the object specified.
The Java Platform Debugger Architecture has been extended so that non-Java programming language source, which is translated to Java programming language source, can be debugged in the future.
A request can now be made to control target VM termination notification, allowing clean shutdown synchronization.
Character handling in J2SE 1.4.0 is based on version 3.0 of the Unicode standard. This character handling affects the Character and String classes in the java.lang package as well as the collation and bidirectional text analysis functionality in the java.text package.
J2SE 1.4.0 supports Thai and Hindi in all areas of functionality. See the Supported Locales document online for complete information on supported locales and writing systems.
Class java.util.Currency was introduced so that currencies can be referenced independent of locales. There are new methods on java.text.NumberFormat and related classes to specify the currency for formatting monetary values.
Java Plug-in 1.4 offers the following new features:
Support of HTTPS through Java Secure Socket Extension (JSSE) rather than the browser
Enhanced applet caching so that other files, such as GIF, JPEG, and AU, can be cached in addition to JAR and class files
Applet persistence across browser page changes
Various applet-compatibility enhancements to allow most JDK 1.1 applets to run seemlessly in Java 2.
Version 1.4 also provides the following:
Access to the DOM through standard, w3c-defined interfaces
Assertion and logging support
Applet usability enhancements that include a customizable progress bar for applet loading
Enhanced options in the Java Console to allow dynamic reconfiguration of proxy settings, the policy file, etc., while the applet is running.
For more information, see http://java.sun.com/j2se/1.4/docs/guide/plugin/index.html.
The collections framework has several enhancements in J2SE 1.4, including a marker interface to advertise random access, an identity-based (rather than equality-based) Map, insertion-order-preserving Map and Set implementations, and several new algorithms for manipulating and returning values from lists. See http://java.sun.com/j2se/1.4/docs/guide/collections/changes4.html for details.
J2SE 1.4.0 offers new support for accessibility in the following areas:
Mnemonic tab navigation on a JTabbedPane
Text editing by assistive technologies
Accessibility of HTML components
Accessibility of Swing Actions
List navigation by using the first letter of list items
Component roles DATE_EDITOR, FONT_CHOOSER, GROUP_BOX, SPIN_BOX, STATUS_BAR
Properties to indicate the presence of a screen magnifier or screen reader, or to specify assistive technologies to load into the Java virtual machine
For more information, see http://java.sun.com/j2se/1.4/docs/guide/access/index.html.
The new package java.util.regex contains classes for matching character sequences against patterns that are specified by regular expressions. For details, see the API specification for java.util.regex at http://java.sun.com/j2se/1.4/docs/api/java/util/regex/package-summary.html.
A new, efficient method for generating prime numbers with no need for the caller to specify a certainty has been added to class java.math.BigInteger. For more information, see http://java.sun.com/j2se/1.4/docs/guide/math/enhancements14.html.
Certain reflective operations, specifically java.lang.reflect.Field, java.lang.reflect.Method.invoke(), java.lang.reflect.Constructor.newInstance(), and Class.newInstance(), have been rewritten for higher performance. Reflective invocations and instantiations are several times faster than in previous releases. For more information, see http://java.sun.com/j2se/1.4/docs/guide/reflection/index.html.
The Java Native Interface (JNI) has been enhanced in J2SE 1.4 to reflect a new feature of the java.nio package: direct buffers. The contents of a direct buffer can, potentially, reside in native memory outside of the ordinary garbage-collected heap. Also, new Invocation Interface routine AttachCurrentTreadAsDaemon allows native code to attach a daemon thread to the virtual machine; this is useful when the VM should not wait for this thread to exit upon shutdown. See JNI Enhancements online at http://java.sun.com/j2se/1.4/docs/guide/jni/jni-14.html.
See also the Tools Changes online documentation at http://java.sun.com/j2se/1.4/docs/tooldocs/tools-changes.html.
The java application launcher supports command-line options for support of the new Assertions Facility. On the SolarisTM Operating Environment (SPARCTM Platform Edition) new command-line options are available for specifying 64-bit or 32-bit operation. New option -Xloggc:file logs each garbage-collection event in the specified file. New option Xcheck:jni() performs additional checks for Java Native Interface (JNI) functions at the cost of some performance degradation.
The javadoc tool has several new tags, a dozen new options, smarter inheriting of doc comments, more control over HTML output, improvements to the doclet API, better error messages, dozens of bug fixes, and is easier to run. For more details, see What's New in Javadoc 1.4 online at http://java.sun.com/j2se/1.4/docs/tooldocs/javadoc/whatsnew-1.4.html. Downloadable as a separate product, the MIF doclet http://java.sun.com/j2se/javadoc/mifdoclet) has had a major upgrade -- it generates API documentation in FrameMaker and PDF format.
The native2ascii tool contains bug fixes to process source files encoded with Unicode encoding correctly.
The idlj tool now generates server-side bindings following the Portable Servant Inheritance Model. This change involves producing new POA bindings by default. A new command-line option is added to enable you to continue to generate backwards-compatible server-side bindings. To learn more about the Portable Servant Inheritance Model, see http://java.sun.com/j2se/1.4/docs/guide/idl/POA.html. For more information on the idlj tool, see http://java.sun.com/j2se/1.4/docs/guide/rmi-iiop/toJavaPortableUG.html.
The orbd tool, or Object Request Broker Daemon, is a new alternative tool for the Transient Naming Service, tnameserv. ORBD includes both a Transient Naming Service and a Persistent Naming Service. The orbd tool is used to enable clients to transparently locate and invoke persistent objects on servers in the CORBA environment. The orbd tool incorporates the functionality of a Server Manager, an Interoperable Naming Service, and a Bootstrap Name Server. When used in conjunction with the servertool, the Server Manager locates, registers, and activates a server when a client wants to access the server. For more information, see http://java.sun.com/j2se/1.4/docs/guide/idl/orbd.html.
The servertool is new to J2SE 1.4. The servertool provides an ease-of-use interface for application programmers to register, unregister, startup, and shutdown a server. For more information, see http://java.sun.com/j2se/1.4/docs/guide/idl/servertool.html.
The rmic compiler has a new option to enable Portable Object Adapter, or POA, support for Remote Method Invocation. The POA enables portability among vendor ORBs, among other uses. To learn more about the POA, see http://java.sun.com/j2se/1.4/docs/guide/idl/POA.html. To enable POA support with the rmic compiler, use the arguments rmic -iiop -poa. For more information on the rmic compiler, see http://java.sun.com/j2se/1.4/docs/tooldocs/solaris/rmic.html.
The graphicalPolicy Tool utility has been enhanced to enable specifying a Principal field indicating what user is to be granted specified access control permissions.