Converting From EclipseME to Mobile Tools for Java
Craig Setera — October 19, 2008 @ 4:52 pm — Miscellaneous
Converting to Eclipse Mobile Tools for Java
UPDATED: It turns out that the original steps I documented for doing the conversion were incorrect. This post has been updated to specify the use of the Eclipse Import wizard to import EclipseME projects as MTJ projects.
UPDATE 2: Added instructions for upgrading preprocessor hooks configuration.
Now that EclipseME forms the base for the new Mobile Tools for Java project, it is now time for EclipseME users to convert to using MTJ. The conversion from EclipseME to the Eclipse Mobile Tools for Java project could not be any easier. Given that Eclipse MTJ is based on the last release of EclipseME, it should be very comfortable for all EclipseME users. The primary thing that may trip up EclipseME users are minor text changes throughout the tools.
There have been a number of questions about why people might want to make the switch over to MTJ. My next post will cover some of the cool new features in MTJ versus the last release of EclipseME. (Not to mention the many bug fixes that were made.)
Making the switch to MTJ involves three primary steps:
- Install the Mobile Tools for Java Support
- Convert EclipseME projects to Mobile Tools for Java projects
- Configure Preprocessor Hooks
- Uninstall the EclipseME Support
It is possible to install MTJ using an Eclipse Update Site or by downloading an installable archive file. MTJ requires at least version 3.3 of Eclipse. I would suggest that you move to Eclipse 3.4 for the best experience. This examples shows the installation of MTJ into Eclipse 3.4 using the update site.
- Open the installation dialog via the Software Updates… menu item in the Help menu.
- Switch to the Available Software tab of the dialog.
- Press the Add Site… button
- Enter the MTJ Update site URL: http://download.eclipse.org/dsdp/mtj/updates/0.9/stable and press OK
- Expand the update site
- Select the MTJ features of interest
Follow the prompts through to complete the installation of the Eclipse Mobile Tools for Java
Import Devices into MTJ
The devices in EclipseME will not be brought over automatically. Import your devices into MTJ so that they are available when importing your your project into MTJ.
Convert EclipseME projects to Mobile Tools for Java projects
The MTJ project provides the ability to convert an EclipseME project over to a Mobile Tools for Java project. This functionality is implemented in the as an Import wizard, requiring a number of steps. There are likely other ways to handle this import operation, but the following steps are relatively straightforward.
Delete the EclipseME Project
In order to import the project as an MTJ project, it is necessary to delete the project from the current workspace. The delete operation must be done carefully to avoid deleting the project from the file system.
When prompted, make sure that the Delete project contents on disk radio box is not selected to avoid accidentally deleting the actual project contents. When this is done, the project is deleted from Eclipse, but not from the file system.
Move the EclipseME Project
In order for the import wizard to find the EclipseME project for the conversion, it must not be located in the workspace folder on the file system. Find the project in your local file system and move it to another location.
Import As EclipseME Project
Launch the Import wizard from the File menu. When the wizard dialog is displayed, choose EclipseME Project from the Java ME category.
When prompted, specify the folder holding your EclipseME project file in the location that it was placed when moved. The import wizard should find the EclipseME project and allow you to do the import. Once finished, the project will be in your Eclipse workspace as an MTJ project.
IMPORTANT NOTE: The way in which keystore passwords are stored has changed in MTJ versus in EclipseME. If your your project stores the keystore password within the project or workspace, you will need to re-enter your keystore password after the conversion has been completed.
Configure Preprocessor Hooks
If you are using the preprocessing support in EclipseME, you will need to update your installation to point to the MTJ preprocessor hooks library. Full information on installing the preprocessor hooks for EclipseME can be found here.. To update your installation for MTJ, change from:
EclipseME and Mobile Tools for Java functionality overlap. If both toolsets are installed, many menus will be replicated and there will be two two Java ME categories in the preferences dialog. While not a requirement, removing EclipseME will make it easier to deal with the Mobile Tools for Java.