The Java
2 Standard Edition (J2SE) aims for the typical desktop platform,
which should easily possess sufficient memory and processing speed
to handle the J2SE class demands. Developers can have high confidence
that if their programs run on one system with the J2SE it will run
on all of them.
Small computer
platforms and embedded systems, on the other hand, involve environments
with an vast diversity of performance capabilities and memory resources.
No single group of Java classes could do justice to systems that
range from a JavaCard with a few kilobytes of memory to a high end
PDA with several megabytes.
As discussed
in Chapter 1,
the initial attempt by Sun to match Java to different micro platforms
resulted in the JavaCard, EmbeddedJava, and PersonalJava
frameworks based on Java 1.1 classes. With Java 2 came the decision
to replace EmbeddedJava and PersonalJava and move to a more systematic
scheme called Java 2 Micro Edition or J2ME (Ref. Topley).
J2ME does
not encompass a single set of classes as do J2SE and J2EE, but instead
it allows for subsets of classes called configurations. Furthermore,
for a given configuration there can be variations called profiles
that add classes to perform specific tasks such as networking over
a wireless connection. J2ME aims to assure developers that if a
program runs on one platform that adheres to a given configuration/profile,
it will run on all of them.
Note that
smart cards with microprocessors provide so little memory (typically
16KB of ROM, 8KB of EEPROM and 512 bytes RAM) that they lie outside
the J2ME framework. The JavaCard API involves a basic JVM that can
run Java applets (JavaCard applets extend the javacard.framework.Applet class, not java.applet.Applet) that use four Java Card packages. See the JavaCard
at sun.com for details.
J2ME
Configurations
The two currently developed configurations include
(Ref. Topley):
CLDC – Connected Limited
Device Configuration
This configuration is intended for systems with memory resources in the
range of 160-512KB such as cell phones and low end PDAs. As of
mid-2004, there are two versions - CLDC 1.0 and CLDC 1.1. The
1.0 version involves only four packages: java.lang, java.io, java.util, and javax.microedition.io., while version 1.1 added the package java.lang.ref.
Version 1.1 also added floating-point operations and a few other enhancements
and needs a minimum of 192KB versus 160KB for the 1.0 version.
CDC – Connected Device
Configuration
These are intended for systems with around 2MB of memory such as smart
phones and set-top boxes. It includes 13 packages.
JVM builders
for these configurations must follow certain restrictions. The configurations
must use J2SE classes if possible and no new classes (i.e. not in
the J2SE) can be added into a core language package such as java.lang. They also cannot modify the method signatures
or fields in the core language classes or add new methods and fields.
So a J2ME program that uses only core language classes should compile
and run under J2SE.
For each
of these configurations there exists a reference virtual
machine. (Third parties are free to develop their own JVMs for these
configurations as long as they perform according to specifications.)
The KVM - Kilobyte Virtual Machine – is the reference VM for the
CLDC.
The KVM
takes up a small amount of memory, uses a garbage
collector especially designed to run efficiently in a memory-limited
environment, and does not include floating-point operations. Usually it is implemented with the core classes
prelinked. That means that essentially a memory image of
a running KVM is burned into ROM so that at start-up the KVM begins
running immediately without the need to load classes.
KVM
version 1.1 supports floating-point and other enhancements for CLDC
1.1. Sun also offers its own CLDC Hotspot™ Implementation JVM that
provides up to a factor of ten faster performance than the KVM.
Like the Hotspot JVM used in J2SE, it monitors a program's performance
dynamically and it compiles frequently invoked methods (i.e. "hotspots")
into native instructions.
CDC platforms
provide sufficient resources to allow for a JVM that meets all of
the standard Java specifications. The CVM was previously the reference
JVM for the CDC, but the CDC HotSpot Implementation has now replaced
it. It provides for the
full J2SE specifications but doesn’t implement acceleration techniques
such as Just-In-Time (JIT) compilation to native codes or Sun’s
Hotspot technology.
J2ME Profiles
A profile
expands a configuration so that it works for a specialized application.
MIDP - Mobile Information
Device Profile
This profile adds classes to the CLDC to provide for networking, graphical
user interfaces, and local storage. It is aimed at wireless systems,
especially cell phones, and allows for the downloading of MIDLets,
which are similar to applets but will download and run on wireless
platforms that are limited to the CLDC capabilities.
MIDP version 2.0 adds various enhancements over version 1.0,
especially with respect to multimedia and game programming and
also for HTTPS (secure HTTP). A complication is that some version
MIDP 2.0 implemenations were built on CLDC1.0 while later ones
were built on CLDC 1.1.
IMP – Information Module
Profile
This subset of the MIDP also applies to wireless systems but those with
little or no graphical interface. It is intended for wireless
access to remote devices such as alarm systems, meteorological
stations, electric meters, and so forth.
Foundation
Profile
This profile for the CDC applies to systems with no graphical interface
such as printers and embedded servers. It only adds three packages
dealing with security tasks.
Personal Profile
A CDC profile that provides for an AWT based GUI. Intended for
high-end PDAs, smart phones, and other resource limited systems
as compared to desktops PCs.
Several other profiles are in development such
as a PDA profile for CLDC that is specialized for those devices.
There is also an optional package for the CDC that provides for
a subset of the J2SE RMI classes to provide for distributed computing
with micro devices.
References & Web Resources
Latest update: Dec. 14, 2004
|