Deploying Java Applications

Introduction

A Java application, unlike a Java applet, cannot rely on a web browser for installation and runtime services. When you deploy a Java application, your software bundle will probably consist of the following parts:

The first item, you already have, of course. The remainder of this document covers the other two items.

Runtime Environment

To run your application, a user needs a Java virtual machine, the Java platform core classes, and various support programs and files. This collection of software is known as a runtime environment.

The JDK software can serve as a runtime environment. However, you probably can't assume your users have the JDK software installed, and your JDK software license doesn't allow you to redistribute JDK software files.

Sun provides a free, redistributable runtime environment called the Java Runtime Environment for Win32 and Solaris systems. The JDK software installer gives you the option of installing the Java Runtime Environment when you install the Java Development Kit. You can also obtain the Java Runtime Environment Version 1.2 Beta 4 from The Java Developer Connection Web Site.

The Win32 versions comes with a built-in installation program suitable for end-users. Solaris versions require the developer to provide installation support.

The Java Runtime Environment for Win32 is available both with and without international support. The non-international version is much smaller, but is suitable only for English-speaking users.

The final step in the deployment process occurs when the software is installed on individual user system. Installation consists of copying software onto the user's system, then configuring the user's system to support that software.

This step includes installing and configuring the runtime environment. If you use the Java Runtime Environment, you must make sure that your installation procedure never overwrites an existing installation, unless the existing Java Runtime Environment is an older version.

The Win32 version of the Java Runtime Environment is distributed as a self-installing executable. A simple way to redistribute the Java Runtime Environment is to include this executable in your software bundle. You can then have your installation program run the executable, or simply instruct the user to install the Java Runtime Environment before installing the rest of your bundle.

The Java Runtime Environment now includes Java Plug-in software, which enables Netscape Navigator and Microsoft Internet Explorer to support the full Java 1.2 platform. To develop applets that use Java Plug-in software, see the Java Plug-in product page on the Java Software web site.

The Win32 installation program records program information in the Windows Registry. This registry information includes the software version, which you should compare with the Java Runtime Environment version in your software bundle. For more information, refer to the the Java Runtime Environment Notes for Developers on the Java Software web site.

A more sophisticated approach is to install the Java Runtime Environment on your own system, then copy the files you need into your own installation set. If you choose this approach, you must include all files described as "required" in the Java Runtime Environment README. The Java Runtime Environment software can only be redistributed if all "required" files are included. See the LICENSE file for specifics.

If you use this approach, do not try to emulate the installation steps performed by the Java Runtime Environment installer. You might "break" an existing Java Runtime Environment installation by missing a new or undocumented installation step. Instead, you should include the Java Runtime Environment files in your own application directory. In effect, your application has its own "private" copy of the Java Runtime Environment.

If your application uses the networking classes, it may not run reliably under Winsock 1.1. If your networking application must support Windows 95, which comes with Winsock 1.1, you will want to include a Winsock 2.0 install in your installation procedure. (Windows NT 4.0 and Windows 98 come with Winsock 2.0.) To provide Winsock 2.0, you need the Microsoft Windows Sockets 2.0 Software Development Kit. This free software can be downloaded from the following addresses:

http://www.microsoft.com/win32dev/netwrk/winsock2/ws295sdk.html
ftp://ftp.microsoft.com/bussys/WinSock/winsock2/