Tuesday, June 10

Developing Java ME on Mac OS X

Updated on: 2008-06-29

To install and setup Netbeans 6.1 on Mac is no problem. Running a J2EE or J2SE application would then be fairly similar to Windows. But running J2ME has a little problem.

To work with mobile application, one can follow the helpful Netbeans + Mobility + Mpowerplayer Guide. However, the guide did not cover how to add optional java package such as jsr75, which I would cover below.

The complete steps to set up a mobile development environment with Netbeans + J2ME Mobility Pack + Visual Designer + Mpowerplayer emulator + optional java package:

  1. Download Netbeans 6.1 IDE for Mac OS X.

  2. Install either the Java SE or Web & Java EE version of the IDE.

  3. After installation, start the IDE and go to Tools > Plugins.

  4. Click the Available Plugins tab. Under Category go to Mobility.

  5. Check the boxes for Visual Mobility Designer, and Mobility and click Install.

  6. Download the Mpowerplayer SDK and install it.

  7. In the NetBeans IDE main menu, choose Tools > Java Platform Manager.

  8. Click Add Platform. Select the folder that contains the MPowerPlayer SDK (mpp-sdk). Click Search to locate the emulator in the folder. When the IDE finds the MPowerPlayer SDK, click Next.

  9. Click Finish. The IDE registers the MIDP platform. You can now build and run a MIDP 2.0 application. But the setup still lacks optional java packages.

  10. Download SUN WTK 2.5.2 (for Windows and Linux)

  11. Unzip the .bin. For example, run the command:

    $ unzip sun_java_wireless_toolkit-2_5_2-linux.bin

  12. Under /lib, copy the optional java package you need eg. jsr75, jsr 179 or even midpapi21.jar. Put them under /Applications/mpp-sdk/stubs/

  13. In your project, edit project.properties and add to platform.bootclasspath the optional java package. eg.

    platform.bootclasspath=${platform.home}/stubs/mmapi.jar:${platform.home}/stubs/midp-2.0.jar:${platform.home}/stubs/cldc-1.0.jar:${platform.home}/stubs/jsr75.jar

  14. Begin mobile development on Mac OS X!


Updates
Instead of using the 2-years-inactive Mpowerplayer emulator, we could instead use MicroEmulator. The difference is to download its Netbeans plugin here.

Tips
In step 13, editing the platform.bootclasspath property is only a temporary solution. The drawback is that when ever you change/view the project properties, platform.bootclasspath will revert back to its original.. What I do is to comment my edited platform.bootclasspath (with a #) and copy and paste it whenever the property is reverted.

16 comments:

branajam said...

Hi,
My name is James Branam and I'm the NetBeans Community Docs Manager. Your blog entry would make a fantastic tutorial for our Community Docs wiki (http://wiki.netbeans.org//CommunityDocs). Would you be willing to contribute it? If you need any help or have any questions, please contact me at james.branam@sun.com. I look forward to hearing from you.

JustDevil said...

Hi branajam,

Thanks for your invitation! Its my honour to contribute to NetBeans Wiki. I will definitely check it out (:

Sam said...

Hi,

I wrote a similar post a few months ago which is more focussed on MicroEmu J2ME on OS X... MPowerPlayer is no longer actively maintained. I notice you have used many of the same steps in your tutorial here. It would be great if you could include NetBeans MicroEmu install instructions. I've filed an RFE for MicroEmu in NetBeans.

JustDevil said...

Hi Sam,

I an a fan of your javablog! I should have tried MicroEmu and not the no-longer-maintained MPowerPlayer. Pardon me as i have switched to mac only 1 week ago, and is loving it (:

softboysxp said...

Hi, I just wrote a very similar post yesterday. I too just swtich to Mac weeks ago, lol

branajam said...

Hi,

This is James again. Please go to our wiki at http://wiki.netbeans.org/CommunityDocs. Instructions for contributing are there. If you have any questions or need any help, please let me know.

I look forward to seeing your contribution on our wiki.

Thanks!
--James Branam
NetBeans Community Docs Manager

Wendong Li said...

Thanks for the link. I moved the content of the ngphone.com site you mentioned to a blog. And a few more UI related projects were added:

Opnen Source Software for Mobile Phones

Wendong Li said...

Oops, I posted the comment on a wrong post. Sorry about that ;)

JustDevil said...

Its okay :) ngphone is great! Thanks for informing!

NM's 236 said...

hi,
i'm kind of stuck on step 12 - where is exactly /Applications/mpp-sdk/stubs/?

also, what does it mean by in your "project" - does it mean we have to execute step 13 everytime we create a netbeans project?

i'm really new to this, any help would be great.

cheers.

JustDevil said...

/Applications/mpp-sdk/ is the folder that you install the mpp sdk. Basically you need to put the jsr files into its stubs folder.

Yes, for each project, you need to do the same.

NM's 236 said...

hi JD, in the beginning when i first installed all this by follow ur instructions, everything worked perfectly. but recently when i try to clean up my desktop a little bit - all of the sudden all my MIDlets won't even run anymore - it won't show the screen with the phone interface (i'm using microemulator, btw). furthermore, i'm receiving this error message:

"Error: Expecting class path separator ':' before 'ME' in argument number 7"

any idea what that might be and how to resolve it?

thx for the help in advance...

Anonymous said...

topic84, [url=http://www.chop.edu/forum/user/profile/8207.page]buy klonopin without prescription[/url], :-) wkx, http://www.chop.edu/forum/user/profile/8207.page buy klonopin :-), [url=http://www.chop.edu/forum/user/profile/8208.page]order xanax 2mg[/url], :-( cuc, http://www.chop.edu/forum/user/profile/8208.page buy xanax 2mg :-(, [url=http://forum.cprs.ca/default.aspx?g=posts&m=6]order adipex[/url], :-( fsh, http://forum.cprs.ca/default.aspx?g=posts&m=6 order adipex online :-(, [url=http://forum.cprs.ca/default.aspx?g=posts&m=7]buy alprazolam without prescription[/url], :-) xdc, http://forum.cprs.ca/default.aspx?g=posts&m=7 alprazolam without prescription *sorry*, [url=http://forum.cprs.ca/default.aspx?g=posts&m=8]buy ambien without prescription[/url], :-( coa, http://forum.cprs.ca/default.aspx?g=posts&m=8 ambien without prescription :-)

Anonymous said...

hi! [url=http://esnips.com/web/minnaregina/]Hello. And Bye.
[/url] http://esnips.com/web/minnaregina/ free nude video clips of milfs
thanks!
free nude video clips of milfs

Anonymous said...

Hello!
Please look our cheapest prices forAmbien. Best sell guarantied. Indecorous Delivery
[url=http://www.testriffic.com/user/MygdsAnge/]xanax overnight no prescription[/url]
[url=http://www.testriffic.com/user/KbmxiZucn/]canadian link online pharmacy xanah.wind.prohosting.com xanax.html[/url]
[url=http://www.testriffic.com/user/VyrklEzkn/]can xanax cause hair loss[/url]
[url=http://www.testriffic.com/user/BkrgjYqpj/]buy xanax no perscription needed amex accepted[/url]
[url=http://www.testriffic.com/user/KszihLcyc/]xanax sleeping pill[/url]
[url=http://www.testriffic.com/user/AhtonVztu/]alberta book guest org site xanax[/url]
[url=http://www.testriffic.com/user/KspnhVfvt/]seroquel risk with xanax[/url]
[url=http://www.testriffic.com/user/CeyhuYjkp/]india buy canadian Xanax[/url]
[url=http://www.testriffic.com/user/UwfwzMprd/]xanax how long does it stay in your system[/url]
[url=http://www.testriffic.com/user/HjlksDftc/]xanax no prescription required[/url]
[url=http://www.testriffic.com/user/BfbixOxhp/]Xanax doctor medikament master card[/url]
[url=http://www.testriffic.com/user/MeadqOwto/]book buy com guest online rufus site xanax[/url]
[url=http://www.testriffic.com/user/BhjhdKnvb/]buy herbal Xanax[/url]
[url=http://www.testriffic.com/user/RgdroFimf/]2xanax.inknoise.com link xanax[/url]
[url=http://www.testriffic.com/user/XjpemTjci/]buy online.batcave.net online.htm viagra xanax[/url]
[url=http://www.testriffic.com/user/JzcxbVahh/]xanax on line prescription[/url]
[url=http://www.testriffic.com/user/UvmijQgom/]withdrawel xanax[/url]
[url=http://www.testriffic.com/user/YwaaiQskb/]buy xanax without a perscription[/url]
[url=http://www.testriffic.com/user/GembzCewv/]maoi xanax[/url]
[url=http://www.testriffic.com/user/ZipedXkxc/]buy cheap xanax.hello.to[/url]
[url=http://www.testriffic.com/user/AkalvVbpx/]ac buy link site vis.galeon.com xanax[/url]
[url=http://www.testriffic.com/user/ZclsrHhsq/]xanax paxil[/url]
[url=http://www.testriffic.com/user/MnxdkHsuc/]buy eteamz.active.com file link pl site tramadolhcl xanax.html[/url]
[url=http://www.testriffic.com/user/FmxccHnbx/]buy cheap xanax overnight delivery[/url]
[url=http://www.testriffic.com/user/ClbtzMfvt/]xanax for anxiety[/url]
[url=http://www.testriffic.com/user/EyfsnEdby/]long term effect where buy Xanax[/url]
[url=http://www.testriffic.com/user/CkcibDkzb/]in long stays urine xanax[/url]
[url=http://www.testriffic.com/user/BespfUtkg/]mexican xanax[/url]
[url=http://www.testriffic.com/user/HzdkbAjjb/]shelf life of xanax[/url]
[url=http://www.testriffic.com/user/YmrloEhzg/]xanax pills information[/url]
[url=http://www.testriffic.com/user/ZhxdqHvxu/]buy fenphen link phentermine.html xanax zyworld.com[/url]
[url=http://www.testriffic.com/user/ZzzmzSnlg/]xanax shipped overnight[/url]
[url=http://www.testriffic.com/user/LplbaRqrg/]compare xanax to zoloft[/url]
[url=http://www.testriffic.com/user/OnxenGuyq/]book buy guest jp number site xanax[/url]
[url=http://www.testriffic.com/user/YcajnNhcq/]shipping buy overnight buy Xanax[/url]
[url=http://www.testriffic.com/user/ZawmbHifp/]without prescription soma xanax[/url]
[url=http://www.testriffic.com/user/AlfmiYmbd/]crystal meth and xanax[/url]
[url=http://www.testriffic.com/user/LjpqqBezy/]pharmacy that ship to apo xanax[/url]
[url=http://www.testriffic.com/user/TxufjSauf/]xanax from mexico[/url]
[url=http://www.testriffic.com/user/UztbrSuah/]buyxanax.htm file site yosefilka.blogspirit.com[/url]

Anonymous said...

Greetings!
Amuse look our cheapest prices for SOMA. Most tender guarantied. Fast Articulation
[url=http://vmtoolkit.com/members/Zoloft+and+xanax.aspx]soma in psychology[/url]
[url=http://vmtoolkit.com/members/Paxil+and+xanax+interaction.aspx]soma ingredients[/url]
[url=http://vmtoolkit.com/members/Soma+fab+smoothie+bicycle+review.aspx]where was the soma cube invented[/url]
[url=http://vmtoolkit.com/members/Soma+shipped+cod.aspx]darvocet v soma[/url]
[url=http://vmtoolkit.com/members/The+rose+at+soma.aspx]soma radicais[/url]
[url=http://vmtoolkit.com/members/Aura+soma+usa.aspx]dosage of soma[/url]
[url=http://vmtoolkit.com/members/Soma+bringer+translation.aspx]buy soma without presciption[/url]
[url=http://vmtoolkit.com/members/Pronstar+soma.aspx]soma in drug tests[/url]
[url=http://vmtoolkit.com/members/Orca+dive+club+soma+bay.aspx]soma codeine[/url]
[url=http://vmtoolkit.com/members/Why+does+soma+give+me+energy.aspx]sleep soma[/url]
[url=http://vmtoolkit.com/members/Soma+marijuana+and+jagermeister.aspx]soma rugs[/url]
[url=http://vmtoolkit.com/members/Soma+addiction.aspx]emergency treatment of soma overdose[/url]
[url=http://vmtoolkit.com/members/Timbuk2+soma.aspx]soma and vicoden effects[/url]
[url=http://vmtoolkit.com/members/History+of+soma+drug.aspx]soma institute shawnee[/url]
[url=http://vmtoolkit.com/members/Buy+fast+online+private+soma.aspx]soma promo coupon[/url]
[url=http://vmtoolkit.com/members/Soma+tablets.aspx]soma dosage instructions[/url]
[url=http://vmtoolkit.com/members/Soma+bringer+follow.aspx]internet prescriptions for soma[/url]
[url=http://vmtoolkit.com/members/Death+from+soma+overdose.aspx]soma buy online[/url]
[url=http://vmtoolkit.com/members/Q+buy+soma+online.aspx]drug information soma[/url]
[url=http://vmtoolkit.com/members/Soma+fit+massage.aspx]soma cheap next day[/url]
[url=http://vmtoolkit.com/members/Soma+versus+flexeril.aspx]buy soma in Idaho[/url]
[url=http://vmtoolkit.com/members/Soma+crystal+bottle.aspx]filetype php soma[/url]
[url=http://vmtoolkit.com/members/Soma+stop.aspx]soma overnight no consult india discount[/url]
[url=http://vmtoolkit.com/members/Drugtests+soma.aspx]soma uncontrolled[/url]
[url=http://vmtoolkit.com/members/Soma+salon+sudbury+ma.aspx]soma no prescrition overnight shipping[/url]
[url=http://vmtoolkit.com/members/Anti+soma.aspx]soma zach[/url]
[url=http://vmtoolkit.com/members/Soma+drug+tests.aspx]cor 13 soma[/url]
[url=http://vmtoolkit.com/members/Soma+carisoprodol+site.aspx]name soma text[/url]
[url=http://vmtoolkit.com/members/Soma+stores.aspx]maximum dosage of soma[/url]
[url=http://vmtoolkit.com/members/Information+on+soma+the+moon+god.aspx]soma puzzle[/url]
[url=http://vmtoolkit.com/members/Soma+mail+medication.aspx]soma sema latin[/url]
[url=http://vmtoolkit.com/members/Soma+fury.aspx]soma cico[/url]
[url=http://vmtoolkit.com/members/L-o+soma+hotel+inc+sanfrancisco+ca.aspx]soma plus alcohol equals morphen[/url]
[url=http://vmtoolkit.com/members/Soma+intimites.aspx]soma compound with codeine[/url]
[url=http://vmtoolkit.com/members/Soma+puzzle+on+a+string.aspx]description of soma[/url]
[url=http://vmtoolkit.com/members/Soma+food+pantry+los+angeles.aspx]soma sema latin[/url]