Historical Evolution

Looking back, several projects have dealt with Java-related programming languages used on consumer devices. These projects were mostly feasibility studies and they were never standardized; but, many of the ideas were incorporated into the J2ME standards. It makes sense to look at the origins of these components to gain a better understanding of why things are as they are in J2ME.

The Green Project

The Green Project began in December 1990. Some people at Sun decided to try to figure out what the next step would be in the evolution of computing and how they could be part of it. They came to the conclusion that the next evolutionary step would be the merger of digitally controlled consumer devices and computers—the kinds of devices we know as Personal Digital Assistants (PDAs) today.

The Sun engineers developed a new SPARC-based, wireless handheld PDA called Star7 or *7. This newly created device was equipped with a 5-inch, 16-bit color LCD with touch-screen input capabilities. In addition, it was capable of communicating with other *7 devices over a built-in 900MHz wireless network. This small device required the development of an OS that would fit in only one megabyte of RAM.

The original plan was to develop the Star7 operating system using C++. However, one of the members of the Green Project, James Gosling, became fed up with C++ and decided to develop a new programming language. The result of his work was a programming language called Oak, which was especially designed to run on devices with significant resource constraints, just like Star7. Thus, Oak had to be very small, efficient, and easily portable to other hardware devices.

Oak was the original ancestor of the Java programming language, which has all the properties just mentioned. (Another byproduct of the Green Project was the Duke, which became the official Java mascot. The Java Duke is a personification of the agent in the user interface of Star7, similar to Microsoft's paper clip.) Star7 was finished and officially presented on September 3, 1992.

In only a few years of development, Java grew to be a leading programming language on desktop computers. However, much of the original focus—to fit a language onto portable computers—was lost during Java's evolution. The new Java development goal became fast execution on desktop machines, regardless of the size of the Java Virtual Machine (JVM). In addition, the standard libraries were extended to several megabytes for developer convenience.

But in 1998, SunLabs got back on the original track and started a new research project, the Spotless System. The goal of the new project was to create a portable JVM that was suitable for embedded systems.

The Spotless System

As mentioned, implementors of Java focused on increasing the speed of the JVM, leading to memory-consuming technologies such as HotSpot. No effort was made to keep those systems small because for desktop systems, the size was not relevant. Consequently, those Java implementations were not suitable for embedded systems offering only a small amount of memory and limited computing power.

This situation changed with the newly created virtual machine of the Spotless System, which was especially designed to fit the constraints of embedded systems. This project had the following main goals:

  • Build the smallest possible complete JVM that supports the full bytecode set, including class loading and non-graphical libraries.

  • Implement the new JVM in highly readable source code in order to provide the best portability to available hardware platforms.

The result of the Spotless System project was a small JVM that occupies less than 300 kilobytes of static memory on a PC system. In order to create an implementation for a real-world embedded device, the engineers first targeted the Rolodex REX personal organizer developed and distributed by Franklin Electronic Publishers. However, this device lacked a development kit, so the engineers switched to the Palm Connected Organizer as a reference platform for their JVM implementation, where excellent support for developing software solutions is available. In addition, the Palm PDA is the most popular PDA currently available in the market.

The original Spotless JVM implementation for the Palm PDA included only a small subset of the class libraries available for desktop Java. As you can see in Table 1.1, the subset is very small even when compared to the actual J2ME configurations discussed in the section “J2ME Configurations and Profiles.” Although the class libraries were sufficient to show feasibility of Java development for embedded systems, they still had some major drawbacks. So the GUI components offered by the spotless package were device-specific to the Palm Connected Organizer.

Table 1.1. Packages and Classes of the Spotless System
Package Name Included Classes
java.lang Class, Error, Exception, IndexOutOfBoundsException, NullPointerException, Object, Runnable, Runtime, RuntimeException, String, StringBuffer, Thread, Throwable
java.io InputStream, IOException, OutputStream, Serializable
java.net InetAddress, ProtocolException, Socket, SocketException, SocketInputStream, SocketOutputStream, UnknownHostException
spotless Beam, Bitmap, Component, Database, Event, External, ExternalException, ExternalManager, Field, Form, Graphics, IO, Label, List, Lst, NativeIO, PButton, Spotlet

The JVM developed in the Spotless System consists of a central application that acts as a class launcher, analogous to the Java command on the desktop. But in contrast to the desktop Java, it includes a complete list of all available Java classes. It gives the user the ability to run any class containing a static main method.

The JavaOne99 KVM Preview Version

At the JavaOne99 conference, some results of the Spotless project got their official place in the Java family. The Java Technology was split into three categories: Java 2 Enterprise Edition (J2EE), Java 2 Standard Edition, and the new Java 2 Micro Edition (J2ME). The heart of J2ME is a new virtual machine, which is specially designed for embedded systems, cellular phones, and PDAs. Because of its low memory footprint of only a few kilobytes, the new virtual machine was named Kilobyte Virtual Machine (KVM). In fact, Sun did not merely announce the new technology; it showed a preview version for PalmOS.

The new KVM was, as you may already have guessed, directly derived from the Spotless System project. However, there are some changes in the supported package names, some classes are canceled, and other classes are added (see Table 1.2). It's still possible to browse through all included Java class files, and all runnable Spotlets that include a main method are now listed in the PalmOS application launcher. The package spotless has been renamed com.sun.kjava; it now includes an enhanced version of the Palm-specific GUI classes.

Table 1.2. Packages and Classes Included in the JavaOne99 KVM
Package Name Included Classes
java.lang Class, Error, Object, Runtime, String, StringBuffer, Thread, Throwable, Exception, IllegalAccessException, IndexOutOfBoundsException, NullPointerException, Runnable, RuntimeException
java.io InputStream, IOExceptopn, OutputStream, Serializable
java.net Socket, SocketException
com.sun.kjava Bitmap, Button, Caret, CheckBox, Database, Dialog, DialogOwner, Graphics, HelpDisplay, IntVector, List, RadioButton, RadioGroup, ScrollOwner, ScrollTextBox, Slider, Spotlet, TextBox, TextField, Trigonometric, ValueSelector, VerticalScrollbar

Note

This class overview is not intended to replace an API reference. It simply describes the formation of the KVM packages and their classes compared with the Spotless System.


Beneath downsized versions of some standard Java packages, the first KVM contained some Palm-specific GUI classes, mostly derived from the Spotless project. A short look at the size of the Java standard package set shows the next problem: A small virtual machine is not really useful without small libraries.

During the months after the JavaOne conference in 1999, some Early Access (EA) versions were released for registered Java developers only. Between those releases, the APIs somehow changed—many bugs were fixed between EA version 0.1 and 0.2, including many virtual machine bugs, and some improvements were made to the com.sun.kjava classes, as well.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset