Packaging

In order to deploy a J2ME MIDlet Suite for use on a J2ME device, it must first be deployed as a JAD and JAR file. EclipseME provides built-in support for packaging a MIDlet Suite into appropriate JAD and JAR files.

How to package your MIDlet Suite

EclipseME packaging support is provided via the J2ME MIDlet Suite project context menu as shown in this snapshot.

screenshot

Packaging Options

There are two packaging options - Create Obfuscated Package and Create Package.

Create Package

When the Create Package action is run, it will deploy the JAD file and JAR file into the deployment directory specified in the Preferences. The deployed JAR file will contain the verified classes and resources.

Create Obfuscated Package

When the Create Obfuscated Package action is run, it will deploy the JAD file and JAR file into the deployment directory specified in the Preferences. The deployed JAR file will be obfuscated by the using the Proguard Java Tool as specified in the Preferences.

Obfuscated packages are useful in providing a small level of security for your deployed MIDlets. More importantly, obfuscation generally leads to smaller deployed JAR file sizes.

In order to produce obfuscated packages, the Proguard Java obfuscation tools must be installed and the root of the Proguard installation must be configured in the Obfuscation Preferences. Proguard is a free open-source library that is available for download from http://proguard.sourceforge.net/.

Errors and Warnings During Obfuscation

It is possible that there will be warnings or errors during the obfuscation process. When this occurs, a prompt will be opened to allow packaging to continue or be cancelled.

screenshot

If the warning or error can be safely ignored, you may select Continue and EclipseME will attempt to continue creating the obfuscated package. Dependening on the type and severity of the problems encountered the package may not be able to be created.

Packaging Outputs

JAR File Deployment

The deployed JAR file will be created in the deployment directory using the following information:

JAD File Deployment

The source JAD file found in the root directory of the J2ME MIDlet Suite project will be copied into the deployment directory during the packaging operation. All changes should be made in the source JAD file as opposed to the deployed JAD file, as the deployed JAD file will be overwritten during the packaging operation.

During deployment of the JAD file, the MIDlet-Jar-Size property of the JAD file will be updated to match the size of the previously deployed JAR file.

Obfuscated Package Outputs

The JAR and JAD files are necessary for deployment to a MIDP capable device. In addition to those files, a number of other files are made available during the obfuscated packaging process. These files are placed in the deployment directory alongside the resulting JAR and JAD files.