logoTop pad
logoBottom
Donate!
Home
License
Prerequisites
News
Installation
Documentation
Downloads
Support
Sourceforge Project Page


Eclipse Ready Logo

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:

  1. Install the Mobile Tools for Java Support
  2. Convert EclipseME projects to Mobile Tools for Java projects
  3. Configure Preprocessor Hooks
  4. Uninstall the EclipseME Support

Install MTJ

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.

install1

  1. Open the installation dialog via the Software Updates… menu item in the Help menu.
  2. Switch to the Available Software tab of the dialog.
  3. Press the Add Site… button
  4. Enter the MTJ Update site URL: http://download.eclipse.org/dsdp/mtj/updates/0.9/stable and press OK

install2

  1. Expand the update site
  2. Select the MTJ features of interest

install3

Follow the prompts through to complete the installation of the Eclipse Mobile Tools for Java
project plugins.

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.

new device import

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.

delete1

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.

delete2

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.

import1

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.

import2

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:

osgi.framework.extensions=eclipseme.core.hooks

to:

osgi.framework.extensions=org.eclipse.mtj.core.hooks

Uninstall EclipseME

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.

17 Responses to “Converting From EclipseME to Mobile Tools for Java”

  1. Alison Chaiken Says:

    I take it that there is not yet any documentation that is specific to MTJ, so we should continue to use the EclipseME docs? (Please don’t take this genuine question as whining; I really appreciate free open source tools!)

  2. María Says:

    I just wanted to say thanks for the helpful tutorial, and also I’d suggest to include one more step. Before importing our EclipseME projects we must import the devices in Window -> Preferences -> Java ME -> Device Management tab, which is empty after installing MTJ.

  3. Adalbert Says:

    If you use preprocessor you must remember about changing in config.ini:
    #for preprocessor Support (http://eclipseme.org/docs/installEclipseME.html#step4)
    #for eclipseme osgi.framework.extensions=eclipseme.core.hooks
    osgi.framework.extensions=org.eclipse.mtj.core.hooks

  4. Neil Says:

    Hi Craig,
    until now I used your EclipseME together with Eclipse 3.2 and didn’t have the intention to change anything at all. Unfortunately I lost my installation (all .exes) due to W32/Virut.V, a deadly virus, so I have to reinstall my whole J2ME environment.

    Because I don’t have that on top of my mind anymore: Is there any tutorial about how to start from scratch with Eclipse and MJT?

    Kind regards

  5. Neil Says:

    Hmm. Should have had a look upward, before posting? :)
    I’ll try that.

  6. Craig Setera Says:

    You may want to try the getting started screen cast… http://live.eclipse.org/node/614

  7. Julio Santa Cruz Says:

    I’ve installed MTJ successfully but I can’t import devices from WTK 2.2 . Into the “Device Management” window, I click Import… then select the root of the WTK directory, then it starts searching through the files and finishes, but it adds no devices. My setup:
    Eclipse 3.3.2
    MTJ 0.9
    WTK 2.2
    Any help will be much appreciated!

  8. Craig Setera Says:

    Julio,

    Please join the MTJ user’s newsgroup and ask your question in there. It is likely this is a configuration problem, but you can get more help there.

    Thanks,
    Craig

  9. EclipseME Home Page Says:

    [...] Converting From EclipseME to Mobile Tools for Java [...]

  10. Carlos Bernardo Says:

    Hi! Craig
    Good job! I’ve followed your tutorial since the first step. My new imported Midlet launched with the default phone without any problem.

    Thank you.

  11. Marcel Says:

    The import from the existing project failed because of my directory structure:
    The source is under
    /src/main/java
    and the MTJ import did assume it under

    so the package names were wrong (src.main.java.org.xmlBlaster…).
    After changing in Properties->Java Build Path->Source
    to the correct ‘/src/main/java’ everything works fine.
    As some of my projects relate to others I had to manually add this reference again.

  12. Heiko Says:

    Converting of old (1.7.7 or earlier) EclipseME projects failed for me with this error message:

    “Creation Problems: Path must include project and resource name: /MyProject”

    Surprisingly, this happened for projects that I had started with an old version even though I edited them with 1.7.9.

    The solution is simple. There is this line in .eclipseme:

    Change it to

    or whatever is the name of your JAD, then importing works. You must delete the semi-imported project, then retry importing.

  13. Heiko Says:

    Argh, my previous comment was mutilated because I used xml tags which are discarded by the web site.

    Here is what I wanted to write, I hope I can use html in the comment:

    [...]
    The solution is simple. There is this line in .eclipseme:

    <eclipsemeMetadata jad=”" version=”1.7.3″>

    Change it to

    <eclipsemeMetadata jad=”MyProject.jad” version=”1.7.3″>
    [...]

  14. Alan Says:

    Please do something easier to convert from EclipseME to MTJ projects… We have here almost 90 projects and converting all of them and assuring mistakes where not made is almost impossible. When you consider that thausands and thausands of people face the same problem, you might agree that the time your team would spend doing this “simple conversion tool” would be like a “socially conscious” effort when compared to the total ammount of effort all your faithful users arround the world will have to do to convert their projects from the earlier version. Unfortunately I cannot migrate to the new version now because of the difficulty to convert all of our projects and libs. Cheers and please keep on improving this great project.

  15. Craig Setera Says:

    Alan,

    Feel free to open a feature request with the MTJ project for such a feature. It is a good idea. The problem is really whether any one on the project has time to devote to such a feature. In such cases, a patch to the project from you would definitely be appreciate.

    Craig

  16. Evgenia Martynova Says:

    First of all thanks a lot for doing this. Does anybody have the problem with MTJ installation? I have got an error: No repository found. I have 3.4.2 version of Eclipse installed. I was trying two ways to install MTJ plugin: online and via archive without any luck. If anybody has a clue I will really apreciate.

  17. Craig Setera Says:

    I would suggest that you visit the MTJ user’s newsgroup at http://www.eclipse.org/dsdp/mtj/news.php to get help with your installation issue.


Copyright © 2005, http://www.eclipseme.org. All rights reserved.