Hi all,
Since January, I have switched from my old
HP Pavilion
(
WinXP
) to a brand new
MacBook Pro
(
Mac OS X
). Such as people use to say on the Internet: I am switcher. I particularly have no issues with Windows. My decision to switch to a Mac was just a matter of learning a new platform.
Anyway, this post is not about my experience on this new platform as a user. In fact, I would to to share with you my experience on how to get Java ME up and running on Mac.
To be honest, set up
Java ME
on Mac is not a difficult task to accomplish, since now we have an official Mac support by Sun Microsystems, regarding Java ME Platform SDK 3. As a matter of fact, the process is equal to the one performed on Windows, for instance. That said, your first step is to
download the SDK from Sun's website and then install it in your
"Applications" folder.
Get it done and now you have to download
Eclipse IDE and
EclipseME plugin. You can download both separately or opt for downloading
Eclipse Pulsar. Eclipse Pulsar is a distribution of
Eclipse
targeted for mobile Java development which contains already comes with EclipseME pre-installed.
Once you have Eclipse and EclipseME installed, now it is time to configure some parameters. The first step is to assign the SDK (former WTK) path on EclipseME. Go to menu
Eclipse > Preferences > Java ME and enter path
"/Applications/Java_ME_SDK_3.0.app/Contents/Resources" in the field "WTK Root". The second step is to import the emulators from Java SDK directory into EclipseME. To do it, go to menu Eclipse > Preferences > Java ME > Device Management and press the button "Import". In the field "Specify search directory", enter the same path as "WTK Root" field. Now, press "Refresh" button and the plugin will search for all the emulators. As soon as this search completes with some result, press "Finish". For more detailed and advanced configurations on EclipseME, check at http://eclipseme.org/docs/configuring.html. To conclude, close the "Preferences" window, by pressing "OK".
Now that you have the environment installed and configured, let's get a sample application running. To do it, you will have to create a simple MIDlet. For instance, create the "Hello, Mac World!" MIDlet, which displays the text "Hello, Mac World!". Considering you have created the file HelloMacWorldMIDlet.java, now let's run the MIDlet. Control + Click on MIDlet file, navigate to menu Run As > Emulated Java ME MIDlet. That's it! Now you have a MIDlet up and running on a Mac. Congratulations!!!
Did you think it was a tough mission, didn't you?
I hope you have enjoyed this micro tutorial. Any doubt, comment here!
See you in the next post...