Java Reference
In-Depth Information
CHAPTER 2
Shrinking Java to Fit
M aking Java run on constrained devices remains a challenge, even nearly a decade
after the first attempts to do so. However, the configurations provided by Java ME are
helping to meet this challenge by bringing the Java platform to the widest possible selec-
tion of devices. By splitting Java into separate configurations—the CLDC for devices with
the lowest possible throughput, and the CDC for constrained mobile devices with mod-
erate memory and processing power—Java ME can provide a computing environment
for nearly every mobile device.
In this chapter, I show you the explicit differences between Java ME and Java SE.
I begin with the CLDC, showing you just what's different between past and present
versions of the CLDC's virtual machine and the virtual machine running the Java SE.
Next I look at the CDC the same way. Finally, I turn your attention to the class libraries
accompanying each of these configurations, showing you precisely which classes both
the CLDC and the CDC support.
Making It Fit: The CLDC
To understand the limitations of the Java ME CLDC, it's important to understand a bit
about the history of the CLDC itself. The CLDC stems from early in the history of Java
when mobile devices were veritable cripples by today's standards. Mobile phones had
well under a megabyte of heap and were powered by processors that would be consid-
ered anemic by today's standards. The initial release of the CLDC was based on an
entirely new virtual machine for small devices, the Java KVM. Consequently, it lacked a
lot of what Java developers were used to. CLDC 1.0, which was documented in JSR 30 in
2000, was the starting point for what has become the Java ME platform.
To keep pace with developments in hardware capabilities and manufacturing costs,
an expert working group of more than 20 companies revised the CLDC standard, result-
ing in JSR 139, which is the standard that defines CLDC 1.1. This standard, completed in
2002, took into account the growing capabilities and markets for mobile devices, and it
added back some features stripped from Java to make Java fit on mobile devices during
the brief period that CLDC 1.0 was available.
19
 
Search WWH ::




Custom Search