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:
- Download Netbeans 6.1 IDE for Mac OS X.
- Install either the Java SE or Web & Java EE version of the IDE.
- After installation, start the IDE and go to Tools > Plugins.
- Click the Available Plugins tab. Under Category go to Mobility.
- Check the boxes for Visual Mobility Designer, and Mobility and click Install.
- Download the Mpowerplayer SDK and install it.
- In the NetBeans IDE main menu, choose Tools > Java Platform Manager.
- 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.
- 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.
- Download SUN WTK 2.5.2 (for Windows and Linux)
- Unzip the .bin. For example, run the command:
$ unzip sun_java_wireless_toolkit-2_5_2-linux.bin - Under /lib, copy the optional java package you need eg. jsr75, jsr 179 or even midpapi21.jar. Put them under /Applications/mpp-sdk/stubs/
- 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 - 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.
12 comments:
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.
Hi branajam,
Thanks for your invitation! Its my honour to contribute to NetBeans Wiki. I will definitely check it out (:
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.
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 (:
Hi, I just wrote a very similar post yesterday. I too just swtich to Mac weeks ago, lol
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
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
Oops, I posted the comment on a wrong post. Sorry about that ;)
Its okay :) ngphone is great! Thanks for informing!
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.
/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.
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...
Post a Comment