A BRIEF DESCRIPTION OF JAVA AND
ITS UTILITY ON WEB PAGES
Daran L. Rife - NWSO Spokane, WA
In the past few years, the Internet and World Wide Web (WWW) have seen exponential growth in usage and content. Many believe the true future of communications lies with the Internet. Web page content has evolved from static, simple black and white text, to a robust, interactive, multi-media environment and this is its main attraction. One of the main technologies behind these advances is Java. This Technical Attachment (TA) seeks to provide a brief description and history of Java, some considerations for those interested in using Java, its utility in National Weather Service Web pages, and a listing of some Java resources.
Most computer languages require that the source code be translated into binary executable code with a compiler. This means that the final result of any program can only be understood by the specific operating system it was compiled on. For example, a computer program compiled on a Windows 95 machine cannot be directly transferred and run on a Unix machine. Sun Microsystems changed all this.
In 1990, top executives at Sun Microsystems Incorporated (hereafter, referred to as Sun) tasked a group of software engineers to develop a computer language that did not rely on platform specific compilers; thus creating a platform 'independent' language. After several years of research, this group developed the Java language.
Java is loosely based on the C++ programming language, but is not tied to platform specific compilers. Sun accomplished this by creating what is known as the Java Virtual Machine (JVM). The JVM is an application which converts Java source code to machine code on the fly. For example, if a Java program is written on a Windows 95 machine, it will still run under the Unix environment, because the JVM will interpret the code for Unix.
The beauty of this is that software developers using Java need only write one version of their application, and it will run on any computer that has a JVM; a feature Sun dubs "Write Once, Run Anywhere". Presently, JVMs are available for Windows 95, the Mac OS, Unix, and several other operating systems. All major Web browsers have JVMs built in them as well. This means that any individual who has a recent version of a Web browser on their computer need not separately install a JVM.
Java requires a reasonably powered, modern computer which uses a 32-bit operating system. Those who do not have such a computer will find poor performance when trying to run Java applications. Fortunately, Western Region Headquarters has provided its field offices with plenty of 32-bit computer systems.
One issue which will be on the minds of those interested in developing and using Java over a networked environment (e.g., the WWW), is security. Sun's original design for Java specified that it was to be used in a networked and distributed environment. With this in mind, Sun made security one of the chief requirements for the Java language.
Java applications used across the WWW prohibit illegal access to memory space, violation of access privileges, or illegal data conversions. This is not to say that Java security is infallible, but it is far stronger than that of other applications used across Web.
The main method in which Java is employed is through Web documents. This is done by using what are known as applets. Applets are mini Java programs designed to run within Web documents, and hence, Web browsers. Applets are different from ordinary software applications in that they reside on centralized Web servers; in the same fashion as Web documents. When a Web client, or browser requests a document that contains an applet, the server delivers both the document and the applet to the client. Then the user's Web browser employs its built-in JVM to run the applet.
Applets have many uses; from simple animations, to interactive programs that allow individual (discrete) users to obtain different information from the same Web page. An example of this is an applet created for the NWSO Spokane Web page.
The applet (titled IndexJava) is a text-based imagemap that greatly simplifies navigation through the Spokane Web site. When the mouse pointer moves over 'hot' text areas, pop-up menus appear, with clickable text parts. IndexJava allows Web users to get at the data they want with one click of the mouse button (seeFig. 1). IndexJava also demonstrates that robust, interactive, and user-friendly applications can be created using Java.
The WWW and the Internet have a host of working applets and applet development resources that may be used. There are also a number of proprietary/non-proprietary computer software programs for developing Java applets. The following is a list of some of these on-line resources.
1) Sun's Java Site is an excellent place to start: http://java.sun.com This site also has a complete (and free) Java development kit (JDK).
2) A truly colossal repository of Java and applet resources can be found at Gamelan: http://www.gamelan.com
3) For ideas on proprietary Java and applet development software go to:
- Lotus BeanMachine at: http://www2.lotus.com/developers/tools/beanmachine
- ObjectShare at: http://www.objectshare.com/p4j/p4j2info.htm
Both these products have free trial versions.
There are, of course, no shortage of books devoted to the subject of Java, and most can be found at any local book store. One of the most comprehensive books was that co-written by a member of the Sun Java development team titled "Java: The Complete Reference", by Patrick Naughton and Herbert Schildt (see references).
The author wishes to thank Mr. Ronald Miller and Mr. John Livingston of NWSO Spokane, and Mr. Donald Britton of NWSFO Great Falls, and Dr. Timothy Barker of NWSO Missoula for their critical review of this TA. Their suggestions have markedly improved its overall quality.
The Computer Network, Various on-line Java informational resources. [Available on the WWW at http://www.cnet.com].
Naughton, P., and H. Schildt, 1996: Java: The Complete Reference. Osborne McGraw-Hill, 886 pp.
Sun Microsystems Incorporated, Various on-line Java informational resources. [Available on the WWW at http://java.sun.com].
Walsh, A. E., 1996: Foundations of Java Programming for the World Wide Web. IDG Books Worldwide Inc., 906 pp.