Tuesday, March 15, 2011

How to Set Up Your Blackberry Development Environment


You can easily develop BlackBerry software applications if you install the right tools on your computer: a Java Software Development Kit (JDK) and a BlackBerry Java Development Environment (JDE). These tools are downloadable for free from the Sun Microsystems and Research In Motion websites.

The JDK supplies the basic tools for compiling Java source code into the bytecode used by the Java interpreter. The JDK also provides the Java interpreter that is used to run many of the development tools in the JDE.

The JDE supplies the BlackBerry-specific tools for transforming Java bytecode into the special format used by the Java-like interpreter on BlackBerry handhelds. It also supplies the debugging and editing tools required for serious software development.

Start by determining which version of the BlackBerry operating system (OS) you plan on targeting. This determines which version of the JDE to use, which in turn determines which version of the JDK to install.

The general rule is this: always use a JDE version equal to or less than the OS version you're targeting. For example, if you're targeting OS 4.3 you can use JDE 4.0, 4.1, 4.2 or 4.3 to develop your application, but not 4.5, 4.7 or 5.0. (The JDE versions skipped 4.4., 4.6, 4.8 and 4.9, by the way.) This isn't a strict rule, because you can sometimes use a later JDE version to build applications that work on older OS versions, but RIM doesn't guarantee that those applications will work or that they will even load on earlier OS versions. (They certainly won't load if you use an API that isn't supported in the older versions.) To be safe, then, you'll always want to use the correct JDE version for the final builds of your application, even if you use a different JDE version for interim development. (There are some nice features in the newer JDE versions, after all.)

Once you've determined which JDE to use, download and install the correct version of the JDK. For JDE versions 4.0.2 and prior, JDK 1.4 is required. For JDE versions 4.1 to 4.2, use JDK 1.5. For versions 4.3 and higher, JDK 1.6 is required. You can download the appropriate JDK from the Sun Microsystems website. (Note that JDK versions 1.4 and 1.5 are quite old now and are no longer officially supported by Sun, but they are still available for download and are required by the older JDE versions.)

After installing the appropriate JDK, download and install the desired JDE from the BlackBerry developer site. You'll need to register for a free account on the site. Don't forget to join RIM's BlackBerry developer program while you're at it.

Different versions of the JDK and the JDE can co-exist on the same machine with no problem if you install them in the correct order: JDK 1.4 first, followed by JDE 4.0; JDK 1.5 followed by JDE 4.1 to 4.2; JDK 1.6 followed by the remaining JDE versions. Otherwise you'll need to alter the paths used by the different batch and executable files in the JDE to use the correct JDK version -- a bit of a hassle, certainly, but not difficult to do at all.








For links to the JDKs and JDEs mentioned, please consult the resources section of the BlackBerry programming website.

Eric Giguere is a software developer and technology writer who offers BlackBerry consulting services among other things. Sign up for his free mailing list to be notified when he publishes new BlackBerry-related content.


No comments:

Post a Comment