Latest BlackBerry Developer Environment
There is an updated article on Getting Started with PhoneGap-BlackBerry with the Latest Environment.
The article below explains how to setup the BlackBerry Developer Environment for JDE v4.0 and lower, which requires an older version of Eclipse.
Supported BlackBerry devices
For supported BlackBerry devices
Setting up Eclipse development environment
These are instructions for setting up your IDE with Eclipse
Please NOTE: If at any point during this setup Eclipse tells you to restart - just do it. Ignoring that messed up a few install attempts for me (yes - I tried getting the IDE running about 3 times before it actually worked). In fact, the way I finally got the IDE set up properly was to reboot after each of a) installing Eclipse, b) installing the BB plug-in and component packs. Yeah, doesn't make sense, but it worked. You're going to love the Windows + RIM SDK combo. Another side note: the first couple of attempts I tried installing the Eclipse RIM plug-in on an install of Eclipse that had the Android plug-in installed as well. This may have been the source of some of my initial problems getting it running. I ended up installing a fresh copy of Eclipse in a different directory and dedicated it to the RIM JDEs - that seemed to work.
1. Get Eclipse 3.4 or 3.4.1 - it has to be one of these versions. http://www.eclipse.org/downloads/packages/release/ganymede/r. (Note: Remember that Eclipse requires Java. If you don't have Java installed, you probably want to install the version that RIM suggests (which is Java 2 SDK, Standard Edition v5.0))
2. Then from this page: http://na.blackberry.com/eng/developers/javaappdev/javaeclipseplug.jsp
Updated link : http://na.blackberry.com/eng/developers/javaappdev/devtools.jsp
a) Download the 'Full Installer' and install the Eclipse plug-in.
b) Download the 'Eclipse Software Update for the BlackBerry JDE v4.6.1 Component Pack' (should be an archive).
c) Download the 'Eclipse Software Update for the BlackBerry JDE v4.7 Component Pack' (again, archive).
3. After the full installer installs the BB IDE plugin, load up Eclipse. (if you already tried this and failed and are installing again, then reboot before loading Eclipse up. Yeah, I know. It sucks. Just reboot.).
4. In Eclipse, go to Help -> Software updates. Click on Available Software tab, click on Add Sites, click on Archive, point the browser to the two component packs you downloaded (4.6.1 and 4.7). These are the only versions of the BlackBerry JDE that the proper browser rendering option works on (not entirely true: JDE version 5 also has it, but it is still in beta at this time). NB: On some installations, instead of clicking on 'Archive' after 'Add Sites', you actually have to extract the component pack archives you downloaded from RIM and click on 'Local...' instead of 'Archive...' and point the file browser to the extracted folder. This seemed to be an issue on a virtual install of Windows XP on a Mac.
5. In Eclipse, there's a Blackberry menu - hit that and click on 'Configure Blackberry Workspace.' (Note: If this option is greyed out, create a new dummy BlackBerry project (File->New->Project)).
6. You should see 'Blackberry JDE' in the side menu and a whole bunch of sub-menus:
a) Blackberry Workspace page: enter '1' for version (or some other number) and something for the Vendor field.
b) Code Signing page: Check every option. Only really necessary for debugging - you probably won't want to have everything checked for an App World release, as that will force you to get additional code signing keys on top of the stock RIM ones (for the extra cryptography API, at least).
c) Installed Components page: Select either 4.6.1 or 4.7 (assuming the component packs you downloaded installed successfully). I usually play around in 4.7 because it is newer, but 4.6.1 should work too. NB: Even though at the time of writing this tutorial we still do not have support for Accelerometer, it looks like 4.7 has support for an Accelerometer sensor listener, whereas 4.6.1 does not. Keep that in mind.
7. Hit apply, that should rebuild your Eclipse workspace.
8. Finally, one last step: once you have a project going, before deploying/testing on the emulator you need to right-click on the project and make sure 'Activate for Blackberry' is checked. If you don't do this, then your application won't show up in the Downloads folder on the emulator/device.
One more thing: if you're testing an app that's using internet / needs connectivity make sure your run the 'MDS-CS' app - it proxies HTTP requests/responses for the emulator. You can find it in Start Menu -> Programs -> Research In Motion -> {JDE Version You're Using} -> MDS-CS
After you run it (either in the emulator or on the device), the application should show up under the Applications menu -> Downloads.
Mac OS X
If you are running Mac OS X and using VMware (tested with XP installed), then steps 2-4 should be replaced with the following:
2. Setup the Blackberry Software Update Site
a) Select Help->Software Updates…
b) Select the Available Software tab
c) Click the Add Site… button
d) In the Add Site dialog, type the URL http://www.blackberry.com/go/eclipseUpdate into the location text box
e) Click the OK button, BlackBerry Update Site appears in the Available Software list
3. Under the Available Software tab (Software Updates), check the Blackberry JDE Plug-in for Eclipse under Blackberry Update Site, and install (note: you will need your BlackBerry Developer Zone ID and Password), then allow it to restart eclipse.
4. Reopen the Help->Software Updates..., and again navigate to the Blackberry Update Site, and select and install Component Pack 4.6.1, and allow it to restart eclipse. Then do the same for Component Pack 4.7. Do these two installs separately.
4.5. Create a new BlackBerry project to initialize the BlackBerry workspace.
- Open the File menu and select New -> Project
- Select BlackBerry Project from the available Wizards and click Next
- Name the project something arbitrary, such as 'test' or 'dummy' and click Finish
- This project can be deleted after creation
If any part of this fails, reinstall eclipse and start over. It's windows. Or skip all of the above and just get the full install of the BlackBerry JDE Plug-in with Eclipse from http://na.blackberry.com/eng/developers/javaappdev/javaeclipseplug.jsp
9. Once you've got Eclipse running, create your first project, select other, select Blackberry. Now download PhoneGap from http://www.phonegap.com/download/, copy the contents of your download/blackberry/framework/src into your new project's src directory and try debugging your project in the BlackBerry simulator to see how PhoneGap's sample templates work.
Random Errors
If you're having trouble getting your application running, and are receiving cryptic error messages and/or error messages with no title/content (yeah, that's happened to me before), try clearing your emulator environment. From Eclipse, BlackBerry menu -> Erase Simulator File -> Erase All. This has fixed random environment/debugging errors for me before. Good luck!