Sunteți pe pagina 1din 4

Configuring EclipseME and Eclipse http://eclipseme.org/docs/configuring.

html#step3

J2ME Development using Eclipse


"From zero to mobile in minutes"

Configuring EclipseME and Eclipse


Home
This docum e nt pro vide s instructions on how to configure Eclipse ME and Eclipse for J2ME de ve lopm e nt.
History
1. Import the Device Definitions
Table of Contents
2. Change Eclipse's Debug Settings
Prerequisites
3. Configure ProGuard (Optional)
Installation
Creating a new project
4. Configure OTA options (Optional)
Creating a new MIDlet
Running/Debugging
1. Import The Device Definitions
Packaging for deployment
Advanced In orde r to use Eclipse ME, you m ust configure at le ast one De vice De finition. In orde r to do this, pe rform the
Reference following ste ps:
FAQ
Troubleshooting 1. Se le ct the Preferences m e nu ite m from Eclipse 's Window m e nu.
Support 2. Ex pand the J2ME ite m in the pane to the le ft and click o n Device Management.
For EclipseME developers
License

Buy Che ap
us e d cars
Buy cars at the
low est prices
Get
tradecarview
membership
today
www.tradecarview.com

3. Se le ct Import...
4. In the re sulting dialog, se le ct the ro ot dire ctory to be se arche d to find k nown de vice s de finitions.

1 of 4 10/18/2010 06:35 PM
Configuring EclipseME and Eclipse http://eclipseme.org/docs/configuring.html#step3

As you le ave the se arch dire ctory te x t fie ld or se le ct the Refresh button, Eclipse ME will be gin look ing for de vice s
in the spe cifie d dire ctory and all subdire ctorie s. As of ve rsion 1.5.0 of Eclipse ME, it is no longe r ne ce ssary to
pick the "pe rfe ct" dire ctory in orde r to have de vice s im porte d, as Eclipse ME should be able to locate the m if
the y re side anywhe re within the spe cifie d dire ctory. Eclipse ME will display the de vice s that are found a s the y a re
found. If you wish to stop the se arch at any tim e , se le ct the Cancel button.
Afte r the se arch ha s com ple te d, use the che ck box e s to se le ct the de vice de finitions to be im porte d. O nly
de vice s that have be e n im porte d into your configuration m ay be use d by proje ct de finitions a nd for la unching.
Finally, choose Finish to com ple te the im port proce ss.
If Eclipse ME fails to locate a de vice de finition that you e x pe cte d would be found, it m ay be that Eclipse ME doe s
not support it for the tim e be ing. In this case , ple ase fe e l fre e to subm it an R FE to ask for support for this
W TK to be adde d. Se e he re for how to do this.
5. W he n you have succe ssfully com ple te d adding the de vice , you should se e the im porte d de vice s in the de vice
m anage m e nt pre fe re nce s.

Save the de finitions by se le cting Finish.

2. Change Eclipse's Debug Settings


Be cause of som e quirk s in the wire le ss toolk its, Sun's in particular, if you are going to de bug your MIDle t using
Eclipse , you m ust change se ve ral of the de fault de bug se ttings. To do this:

2 of 4 10/18/2010 06:35 PM
Configuring EclipseME and Eclipse http://eclipseme.org/docs/configuring.html#step3

1. Se le ct the Preferences m e nu ite m from Eclipse 's Window m e nu.


2. Ex pand the Java ite m in the le ft pa ne and click on the Debug e ntry.
3. Ensure that both Suspend execution on uncaught exceptions and Suspend execution on compilation errors ne a r the
top of the dialog a re NOT che ck e d.
4. Incre ase the Debugger timeout ne ar the bottom o f the dialog to at le ast 15000 m s.
5. The re sulting se ttings should look so m e thing lik e this:

If you do not m ak e the se change s you will ge t e rrors whe n you try to run your MIDle t.

3. Configure ProGuard (Optional)


If you will be using ProGuard to produce obfuscate d pack age s, you will ne e d to configure it into the plug-in. To do
this:

1. Se le ct the Preferences m e nu ite m from Eclipse 's Window m e nu.


2. Ex pand the J2ME and the Packaging ite m s in the le ft p ane and click on the Obfuscation e ntry.
3. C onfigure the ProGuard R oot Dire ctory ne ar the top of the dialog.
4. C onfigure any othe r ProGuard-spe cific se ttings that you ne e d. For m ore inform ation on ProGuard, se e the
ProGuard Source Fo rge site .
Important note for Microsoft Windows Users: By de fault, ProGuard assum e s that you are using an o pe ra ting
syste m that can distinguish be twe e n two file nam e s tha t diffe r only in the ir case (i.e . A.java and a.java are
two diffe re nt file s. This is cle arly not the case in Microsoft W indows. W indows use rs should be sure to spe cify
the -dontusemixedcaseclassnames option to ProGuard. If you fail to do this, and if you ha ve m ore tha n 26
classe s in your pro je ct, ProGuard's de fault use of case -se nsitive file nam e s will cause classe s to ove rwrite one
anothe r. For safe ty, be ginning with re le ase 0.9.0 of Eclipse ME, the -dontusemixedcaseclassnames option is
include d as one of the de fault argum e nts to ProGuard. UNIX use rs with proje cts with m any classe s m a y be able
to achie ve a sm all re duction in the final size of the ir JAR file by re m oving this option.
5. The re sulting se ttings should look so m e thing lik e this:

3 of 4 10/18/2010 06:35 PM
Configuring EclipseME and Eclipse http://eclipseme.org/docs/configuring.html#step3

4. Configure EclipseME's Over The Air (OTA) Options (Optional)


If you will be using Eclipse ME to de bug your MIDle t in O ve r The Air (O TA) m ode , you m ay wa nt to adjust the O TA
Pre fe re nce s. To do this:

1. Se le ct the Preferences m e nu ite m from Eclipse 's Window m e nu.


2. Ex pand the J2ME ite m in the le ft pa ne and click on the Over The Air e ntry.
3. The de fault se ttings look lik e this:

At this point, you a re re ady to use Eclipse ME to cre ate MIDle t suite s. Be fore you do so, howe ve r, we strongly
re com m e nd that you re ad the se ctio n on Be st Practice s.

C opyright © 2005, http://www.e clipse m e .org. All rights re se rve d.

4 of 4 10/18/2010 06:35 PM

S-ar putea să vă placă și