How to Configure Eclipse with the EclipseME plugin

Rose-Hulman Institute of Technology –
Computer Science & Software Engineering

Overview

Once you have Eclipse 3.5 installed, follow these directions to configure it with the EclipseME plugin to develop J2ME applications.

Make sure all required software is installed

  1. Eclipse 3.7/Indigo 

    If you need to install it, follow these instructions.

    The instructions below work for Eclipse 4.2/Juno as well, in case you have a Juno installation.

    These configurations work for both 32-bit and 64-bit Eclipse installations.

  2. Java Wireless Toolkit 2.5.2 for CLDC

    If you need to install it, follow these instructions.

Install EclipseMe for Eclipse

Except where noted you can simply accept the defaults.
  1. Log in to your regular user account
  2. Start Eclipse.
  3. Select Help → Install New Software...
  4. If you already have the required EclipseME plugin (check by going to Help Install new Software and click on the link at "What is already installed") you may skip ahead to Writing Your First Program below.
  5. Click on the Add button and type in this url http://www.eclipseme.org/updates/ and give it a name (e.g. EclipseME).  If you get an error that says "Duplicate locations", click the Cancel button.  Pull down the dropdown list to the right of the "Work with" text field and select the  "EclipseME - http://www.eclipseme.org/updates/" option.  Check "EclipseME" in the main section of the window and click the Next button.
  6. Click Finish, or accept the License agreement and click Finish.
  7. Wait 10-15 seconds while it installs.
  8. If a dialog box pops up giving a warning that you are installing unsigned content, click OK to continue installing.
  9. Answer "yes" to the "restart Eclipse?" question.
  10. EclipseME is now installed!

Writing Your First J2ME application

  1. Now that you have EclipseME installed, you might want to create a project.
    1. To create a new project configured for J2ME, go to File → New → Other (or click the New button in the upper left or press Ctrl+N).
    2. Expand the J2ME folder.
    3. Select J2ME Midlet Suite.
    4. Enter the desired Project name and click the Next button.
    5. At this point, if you have yet to initialize your virtual wireless devices, it will prompt you to do so.
  2. Initialize a virtual wireless device.
    1. Click the Manage Devices button.
    2.  Click the Import button in the upper right corner.
    3.  Browse to your installation of Java Wireless Toolkit (my default was C:\WTK2.5.2_01).
    4. Click the Refresh button and wait while it finds your available cell phone emulators.
    5.  Click the Finish button.
    6. Select a default phone of your choice then click the OK button.
    7. Click the Finish button to create your project.
    8. Normally, instead of initializing the phones, you will be given the option to choose which one will be used for this project (You can change it later by project properties →  J2ME).
    9. To make a Midlet (like an applet, but for a phone), click on the name of your project in the Package Explorer view, then go to File New Other, and then choose J2ME Midlet.
    10. Within this project, feel free to write normal classes; however, note that  the library will be limited since you are writing code for a mobile device.
  3. Running/Debugging a MIDlet.
    1. In order to properly debug a MIDlet, you must change some of Eclipse's default debug settings.  Instructions on how to do so are available on the  Configuring EclipseME and Eclipse web page. They are repeated here for your convenience.
      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. Click the OK button after making these changes.
    2. To run/debug your MIDlet, follow these simple steps, which are adopted from the instructions given on EclipseMe's website.
      1. Expand your project in the Package Explorer view.
      2. Expand the src folder and right click on the main Java class that extends the MIDlet class.
      3. Hover your mouse over the Run As/Debug As context sensitive menu.
      4. Click on the Run As/ Debug As "Emulated J2ME Midlet" option. 
  4. Information on available components and API documentation
    1. API Documentation for the MIDlet Class.
    2. J2ME Tutorial, Part 2: User Interfaces with MIDP 2.0
  5. Sample projects