Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

A library and how to use it

by Retired on ‎02-17-2010 01:51 PM (2,493 Views)


This article applies to the BlackBerry® wireless devices based on Java™.


A library is a project that enables objects and methods to be used in other projects. Using libraries is a good way to write applications that are both modular and reusable. For example, if you write a custom field or custom manager that you want to use in several programs, you could implement these custom objects in a library project and use them in many other projects, having only written the code once.

To mark a project as a library, complete the following:

  1. Right-click the project and click Properties.
  2. On the Application tab, in the Project Type drop-down list, select Library.

    If you want to use this library in another project, the library must be located in the same workspace as the project in which you want to use it.

  3. Right-click the project in which you want to use the Library and click Dependencies.

    The libraries that exist in the workspace appear beside check boxes. Select each of the libraries on which your application depends to run. If you attempt to use a library that has not been set as a dependency, a ClassNotFound exception occurs during compilation.

Users Online
Currently online: 19 members 822 guests
Please welcome our newest community members: