Home : Course Map : Chapter 1 : Java : Supplements :
Deployment of Java Applets and Applications
JavaTech
Course Map
Chapter 1
Introduction
History
What is Java?
Versions
Java 5.0
Features

Java Process
Tools
Documentation
Compatibility
Getting Started
Simple Applet
Simple Application
Starters
Exercises

    Supplements
Interpret/Compile

Making WebPages
Plug-in
Java 5.0 Features
The JVM
Advanced JVMs
Alt. Compilers
Alt. JVMs
Java Deployment

     About JavaTech
     Codes List
     Exercises
     Feedback
     References
     Resources
     Tips
     Topic Index
     Course Guide
     What's New

After creating an applet or application you probably want others to run it. As we emphasized several times, you can port Java programs to many different machines. However, the catch is that this assumes that the platform you port to has a JVM of the proper version installed..

Java has cycled through several major versions and updates and is now at version 5.0 (previously referred to as 1.5), which appeard in 2004. Unfortunately, the most common platform, MS Windows, usually only includes a version 1.1 compatible JVM, if at all. (However, as discussed in the Java Plug-in section, it is easy for MS Windows Users to install the JVM at www.java.com.)

This situation arose primarily from Microsoft's decision to stop supporting Java. In addition, Java found its major successes with applications in the enterprise and embedded environments rather than with applets and client applications. This made putting the latest JVM on the desktop a lower priority for Sun.

So if to insure that your Java applet and/or application runs on a target users machine you must choose from various deployment options.

Deployment Options

For applications you can

  • Install the SDK or the Java Runtime Environment(JRE) - the SDK is intended for those planning to do program development. The JRE, on the other hand, includes the JVM and other executables but none of the program development tools and documentation.

    You can instruct users on how to download and install JVMs from Sun or other sources. The SDK/JRE installations will also install plug-ins for most types of browsers. In this option, both applets and applications can run code compatible with same version.

  • Application installer with JRE - an installer program unpacks and places a program and its various supporting files into the proper directories. There are installers that will examine the system to find if a suitable JVM exists on the system and, if not, it will offer to install a JVM. This approach is elegant but can be expensive if a commercial installer is used.

  • Java Web Start - this system from Sun allows a user to download trusted applications and run them locally. A click on a web page link initiates a Web Start plug-in that downloads the application and launches it. The app will be cached locally so that subsequently the program will run without a download if no updated version detected. Also, the application can run outside of the browser. This system allows the developers to distribute programs to clients while ensuring that the latest versions are in use. If the app needs to access local resources, it will display a dialog to request the access.

    The system requires some setup with regard to the server and the user must download the Web Start plugin. See this developers guide for instructions on how to set up Web Start.

For applets:

  1. Browser Plug-in for applets - for applets the tags can be set up to initiate the downloading and installation of a plug-in with the latest JVM. Or you can just tell your visitors to go to www.java.com to install the plug-in. See the Plug-in page.

  2. Restrict users - target your applets to those that you know for sure have installed an up-to-date JVM on their systems, such as your lab group.

  3. Use only version 1.1 compatible code - this option restricts your applets to the limitations of version 1.1, but will make your applets available to the widest possible audience. You can make your applets compatible with 1.1 by using only classes and methods that existed under 1.1. If you do that, the bytecodes produced by the later versions of the compiler can still run in a 1.1 VM. (The Java 2 API Specification indicates whether or not a package, class, or method appeared after 1.1).

  • As mentioned in the Programmming Tools page, with Java 1.4 and 5.0 you target the class files for compatability with earlier Java versions.

         > javac -target 1.1 MyApplet.java

We strongly recommend the latter two options. Java has now evolved through four major revisions since 1.1 and so it is a great waste of capability to restrict yourself to 1.1 level coding. Major improvements, for example, in the graphical user interface came with the Swing set of components and the Java2D API.

So you must decide on the target users for your application/applet and how much work you can expect them to do. For example, if you develop an application for a small research group, asking the members to download and install the JRE installation themselves could be a reasonable request. It will also be easier with a small group to inform them when new versions of Java appear and an updated application needs the newer JVM. The users will need to uninstall the old version and install the new version.

On the other hand, if you aim your application for a large number of users, the installer combination would be the most workable and user friendly approach.

Although much of the coding in this course will run under a version 1.1 compiler and JVM, we assume the use of a Java 5.0 Java Virtual Machine (JVM).When you install the current SDK, it will also install a plug-in into your browsers.

References & Web Resources

 

Latest update: Oct.6, 2005

            Tech
Java in Science
    & Engineering
Benefits
Shortcomings
RealWorld Examples

           Physics
Java in Physics
SimulationTypes
Simulate&Analyze
Sim. in Experiments
  Demo 1: Event
  Demo 2: Continuous
  Demo 3: Static

Learn by Coding
Exercises

  Part I Part II Part III
Java Core 1  2  3  4  5  6  7  8  9  10  11  12 13 14 15 16 17
18 19 20
21
22 23 24
Supplements

1  2  3  4  5  6  7  8  9  10  11  12

Tech 1  2  3  4  5  6  7  8  9  10  11  12
Physics 1  2  3  4  5  6  7  8  9  10  11  12

Java is a trademark of Sun Microsystems, Inc.