Sunday, March 14, 2010

Eclipse MJT + Java ME 3.0 SDK + Mac OS X

Right now I'm getting started doing some Jave Micro Edition development on a new 15'' MacBook Pro. I'm familiar with Eclipse so thought I would start with the Pulsar distro, which includes Eclipse Mobile Tools for Java. I read somewhere that Cocoa 32-bit is the version to go for on newer MacBooks so I used that.

The final prerequisite was a Java ME SDK/Toolkit. Where better I thought than to start with Sun, since they had just released a Mac OS X version of their latest SDK. This was the follow up to the frequently cited, but Windows-only, Java Wireless Toolkit 2.5.2. So I download and install that, everything looking good so far.

Next I go to create a new MIDlet project in Eclipse. Clicking through the screens I ended up needing to import some Java ME devices and it's at this point things got tricky. Where were the device definitions?

My natural instinct was to try to choose the Java ME SDK I'd just installed, but hitting Browse... and going to /Applications it didn't let me choose Java_ME_SDK_3.0. Now this is where the part about me doing dev on a new MacBook Pro comes is relevant. I'm entirely new to Mac OS X so at this point didn't release the thing that the thing called Java_ME_SDK_3.0 in the file chooser was in fact a directory called Java_ME_SDK_3.0.app.

The Eclipse MTJ getting started video wasn't much help because it referenced Sun's older Windows-only Java Wireless Toolkit. After much googling I finally hit this article about creating your own devices, I plugged in the same directory it referenced:
/Applications/Java_ME_SDK_3.0.app/Contents/Resources/
hit Refresh and after some searching all was good with the world...



Next step is to actually get something compiling :-).