Configuring EclipseME and Eclipse

This document provides instructions on how to configure EclipseME and Eclipse for J2ME development.

  1. Configure the Wireless Toolkit Settings
  2. Change Eclipse's Debug Settings
  3. Configure ProGuard (Optional)
  4. Configure OTA options (Optional)

1. Configure the Plug-In's Wireless Toolkit Settings

In order to use the plug-in, you must configure at least one Wireless Toolkit. In order to do this, perform the following steps:

  1. Select the Preferences menu item from Eclipse's Window menu.

  2. Expand the J2ME item in the pane to the left and click on Platform Components.
    screenshot

  3. Right-click on Wireless Toolkits and select Add Wireless Toolkit.

  4. In the resulting dialog, select the root directory of the wireless toolkit installation.
    screenshot

    If you're adding a Wireless Toolkit for which EclipseME has explicit support (or for certain Universal Emulator Interface (UEI) compatible WTK's) once you have selected the root directory of the WTK installation, EclipseME should be able to identify the toolkit, and you can press the Finish button to complete the operation.

    If you select the root install directory for your WTK and EclipseME responds with an "Invalid wireless toolkit root," then you are attempting to add a WTK for which EclipseME does not provide direct (native) support, and for which it could not locate Universal Emulator Interface (UEI) information. The UEI interface allows EclipseME to query the emulator to determine the required settings, classpaths, etc. EclipseME assumes that the emulator is located in a directory named bin. This is usually, but not always, located under the root of the WTK installation area. If it is, EclipseME will find it automatically when you select the WTK root directory.

    If the bin directory is not directly under the root of the WTK installation, then you need to help EclipseME locate it so that EclipseME can interrogate the emulator. Find the bin directory, and select that directory's parent in the Browse dialog. Thus, in the example below, the bin directory was nested several layers deep. Selecting WTK2 (bin's parent) allows this toolkit to be recognized.
    screenshot

    If EclipseME persists in showing the "Invalid wireless toolkit root" error even when you have selected the parent of the bin directory, then either the emulator has a non-standard name, or the emulator does not support the UEI standard. In either case, EclipseME can not support it for the time being. In this case, please feel free to submit an RFE to ask for support for this WTK to be added. See here for how to do this.

  5. When you have succesfully completed adding the toolkit, you should be able to expand the Wireless Toolkits and other items in the right-hand pane and see the toolkits, definitions, profiles and configurations that are installed.
    screenshot

2. Change Eclipse's Debug Settings

Because of some quirks in the wireless toolkits, Sun's in particular, if you are going to debug your MIDlet using Eclipse, you must change several of the default debug settings. To do this:

  1. Select the Preferences menu item from Eclipse's Window menu.

  2. Expand the Java item in the left pane and click on the Debug entry.

  3. Ensure that both Suspend execution on uncaught exceptions and Suspend execution on compilation errors near the top of the dialog are NOT checked.

  4. Increase the Debugger timeout near the bottom of the dialog to at least 15000 ms.

  5. The resulting settings should look something like this:
    screenshot

If you do not make these changes you will get errors when you try to run your MIDlet.

3. Configure ProGuard (Optional)

If you will be using ProGuard to produce obfuscated packages, you will need to configure it into the plug-in. To do this:

  1. Select the Preferences menu item from Eclipse's Window menu.

  2. Expand the J2ME item in the left pane and click on the Obfuscation entry.

  3. Configure the ProGuard Root Directory near the top of the dialog.

  4. Configure any other ProGuard-specific settings that you need. For more information on ProGuard, see the ProGuard SourceForge site.

    Important note for Microsoft Windows Users: By default, ProGuard assumes that you are using an operating system that can distinguish between two file names that differ only in their case (i.e. A.java and a.java are two different files. This is clearly not the case in Microsoft Windows. Windows users should be sure to specify the -dontusemixedcaseclassnames option to ProGuard. If you fail to do this, and if you have more than 26 classes in your project, ProGuard's default use of case-sensitive file names will cause classes to overwrite one another. For safety, beginning with release 0.9.0 of EclipseME, the -dontusemixedcaseclassnames option is included as one of the default arguments to ProGuard. UNIX users with projects with many classes may be able to achieve a small reduction in the final size of their JAR file by removing this option.

  5. The resulting settings should look something like this:
    screenshot

4. Configure EclipseME's Over The Air (OTA) options (Optional)

If you will be using EclipseME to debug your MIDlet in Over The Air (OTA) mode, you may want to adjust the OTA Preferences. To do this:

  1. Select the Preferences menu item from Eclipse's Window menu.

  2. Expand the J2ME item in the left pane and click on the Over The Air entry.

  3. The default settings look like this:
    screenshot

At this point, you are ready to use EclipseME to create MIDlet suites. Before you do so, however, we strongly recommend that you read the section on Best Practices.