J2ME stands for Java 2 Micro Edition. This platform of Java is used to develop applications for resource constraint devices such as mobile phones, PDAs, set top boxes, etc.
The J2ME comprises three major components. These components are as follows:
- Configuration
- Profile
- Optional Packages
Each component is discussed below:
The configuration defines a set of core Java 2 platform libraries as well as a Java Virtual Machine. There are two types of configurations available: CLDC and CDC.
The Java Community Process developed CLDC as JSR 30. The CLDC defines runtime environment for devices with limited storage capacity. It is designed for 16-bit or 32-bit devices. CLDC complacent devices have memory capacity ranging between 160-512 KB.
CLDC also defines Kilobyte Java Virtual Machine (KVM), also known as the stripped down version of the complete Java Virtual Machine. It is known as the stripped down version because it has the following limitations:
- It does not support floating-point numbers.
- It does not support weak references.
- It does not support thread groups.
- It does not support object serialization.
- It does not provide any support for Java Native Interface (JNI).
The CDC has been defined by Java Community Process as JSR 36. It defines runtime environment for devices that have minimum 2 MB memory, 32-bit processor, and a network connection. It defines Java 2 SE platform core libraries and a full-fledged Java Virtual Machine. The CDC specific profiles are foundation profile, personal profile and personal basis profile. The JVM of CDC is often called as CVM. It provides support for the following:
- Floating point numbers
- JNI (Java Native Interface)
- Weak Reference
- Object Serialization
- Reflection
The profile, which is a standard set of APIs, complements the configuration. In collaboration with configuration, it provides a complete runtime environment for J2ME applications. It provides classes for implementing user interface, persistent storage, etc., in J2ME applications.
The list below describes different Profiles in use:
- MIDP: It stands for Mobile Information Device Profile. This profile is aimed at devices having very less memory storage, low processing speed, etc. It complements the CLDC configuration. It provides networking components, user interface components, and persistent storage to CLDC based applications.
- PDA Profile: This profile is aimed at devices having more storage power, larger screen size, and better processing speed than MIDP devices.
- Foundation Profile: This profile complements CDC configuration. It contains all Java 2 version 1.3 libraries.
- Personal Basis and Personal Profiles: This profile adds user interface to the foundation profile. It is designed for platforms that can manage more complex user interface.
- RMI Profile: This profile adds the J2SE Remote Method Invocation classes to the foundation profile.
- Game Profile: This profile is aimed at providing a platform to create games on CDC complacent devices. This profile is currently under development.
The WMA (Wireless Messaging API) is an optional package that contains classes required for sending and receiving messages on mobile devices. This package is useful for devices that provide short message service.
The JDBC (Java Database Connectivity) is an optional package that provides a subset of the JDBC 3.0. This package contains classes and methods to allow developers to access data sources, including spreadsheets and flat files, as well as other DBMS through Java based applications.
The J2ME configurations, profiles, and optional packages are defined by Java Community Process (JCP). The JCP can be viewed as a forum to create and revive Java technology specifications. Each configuration and profile is defined as Java Specification Request (JSR). The table below defines some JSR specifications with their respective configuration and profile:
| JSR 30 | CLDC 1.0 |
| JSR37 | MIDP2.0 |
| JSR 46 | Foundation profile |
| JSR 36 | CDC |
| JSR 134 | Game Profile |
| JSR 139 | CLDC 1.1 |