Lukas Hasik's notes about work life (and more)

XML

Subscribe to Lukas Hasik's Weblog on your cell phone Powered by Technorati

Let's have a ride
« October 2005 »
SunMonTueWedThuFriSat
      
1
2
5
8
9
15
16
17
19
22
23
25
26
27
28
29
31
     
Today


Today's Page Hits: 1673

my.netbeans.org

News in pictures


the links



Recent Entries

Lukas Hasik's Weblog
All recent entries

Licence Info

This work is licensed under a Creative Commons License
LICENCE

Map of visitors

Locations of visitors to this page
Listed on BlogShares


20051020 Thursday October 20, 2005
[TIP] Mobility Pack on Mac TIP

UPDATE: Follow this link for update about 6.1 release and Mac. You can find setup for 6.0 in comments.

There is no official build of Mobility Pack for Mac. There exist a trick/hack how to use Mobility Pack on Mac. I'd like to say that everything that is written bellow is on your own risc and do not expect any support from Mobility Pack side when an problem occurs. I just wanted to try it on Mac and share this information with you.


Install IDE and Emulator
Download NetBeans5.0 (FCS for Mac and install it. There isn't a build of Mobility Pack for MacOS but you can install it on windows or linux and then just pack or copy directory '{nb_install}/mobility7.2'. Unzip it then to your NetBeans installation directory on Mac. You can start NetBeans now. The Mobility Pack should be available in IDE. You can create a Mobile project but you cannot run it yet. We need an emulator first.
There is free emulator working on MacOS - mpowerplayer. Download it, unzip and then change preverify({mpp_install}/osx/preverify/preverify}) to be runable (chmod +x).

Add Emulator Platform to IDE
Go to Tools > Java Platform Manager, press Add Platform... button. Then select Custom Java Micro Edition Platform Emulator and 'Next'

Set up Platform Home to the mpowerplayer installation directory. 'Platform Name' and 'Device Name' aren't really important here. You can name it as you want e.g. 'mpowerplayer' and 'mpp'.
Set up Preverify Command to
"{platformhome}{/}osx{/}preverify{/}preverify" {classpath|-classpath "{classpath}"} -d "{destdir}" "{srcdir}"
then set up Execution Command
java -jar {platformhome}{/}player.jar {jadfile}
You will have to have java installed, of course. The IDE won't run without it anyway :)
Set up Debugger Command
java -Xdebug -Xrunjdwp:transport={debugtransport},server={debugserver},suspend={debugsuspend},address={debugaddress} -jar {platformhome}{/}player.jar {jadfile}
Press 'Next' button.

You will have to choose which jars you need in Bootstrap Libraries. You can leave all jars that IDE found for you in the list but you'll have to add classes.jar from Java. You should find it in System/Libraries/Framework/JavaVM.Framework/classes directory. Use java 1.4 or 1.3

The libraries from mpowerplayer directory enable you to develop only in MIDP1.0 and CLDC1.1. You will need libraries for MIDP2.0 and CLDC1.0 to be able to develop for this profile and configuration. You can get these libraries from the bundled WTK that is in ~/.netbeans/5.0/emulators/wtk22_win/emulator/wtk22/lib. Their names are obvious cldcapi10.jar, midpapi20.jar.
Then you can click 'Finish' and new emulator platform apprears in platform list. You can use this new platform for your projects.


Run a Project in Emulator
Create new project from File > New Project..., select Mobile and Mobile Application, click 'Next', choose a location and name for your project, let the checkbox Create Hello MIDlet checked, click 'Next', select the mpowerplayer as Emulator Platform, you can 'Finish'.
New project appears. Run it and it should compile and run in the emulator.

You are able to create, compile, debug a Java ME project in NetBeans with Mobility Pack now.

I'd like to thank to David Kopp that has found the debug command.

UPDATE: there are 2 threads solving interesting issues on http://developer.mpowerplayer.com

UPDATE for 5.5 release: After unzip of the 'mobility7.2' directory you have to add line with 'mobility7.2' to file '{nb_install}/etc/netbeans.clusters'. After restart of IDE the Mobility Pack should work.


Comments [24] ( Oct 20 2005, 04:00:00 PM CEST ) Permalink del.icio.us furl simpy slashdot technorati digg


Disclaimer: The contents of my blog represent my personal opinions which may differ from official views of my employer, Sun Microsystems.