Problems with SmartLinker

A program called SmartLinker is used to strip unused classes and methods before packing a project into a .jxe file. Although this gives the benefit of a much smaller application, it also causes dynamically loaded classes to be stripped from the application when the .jxe is built.

An example of this is the various adapters that are dynamically loaded for different environments. Because these adapters are not explicitly refered to anywhere in the code, they are removed and so a NoClassDefFoundException is thrown.

The cleanest way to solve this problem is to specify in the jxeLinkOptions file that you wish to include a specific class. You can do this in WSDD in the following manner:

  1. In the packages view of your project, open the directory for the device you are creating the jxe for (e.g. palm68k) and open the jxeLinkOptions file (e.g. ExampleApp.jxeLinkOptions.
  2. Select the in or exclusion tab and pic [include whole classes] from the pulldown menu. This screen shows all the classes that the user has specified will definitely be included.
  3. To add a new class to the list, select [new] and enter the class in the [Rule pattern] box, for example . com.ibm.mqe.adapter.MQeMidpFieldsAdapter. The following files require inclusion in this manner for the MIDP clients to work:


© IBM Corporation 2002. All Rights Reserved