Creating an External Library

In this section, you will be learning how to create an external library to be integrated to the MTJ MIDlet Wizard.

Summary:

The external library creation process is composed of the following tasks:

  1. Create a folder structure for the library jar and resources;
  2. Extend the org.eclipse.mtj.core.externallibrary extension point;
  3. Fill in the library's branding info;
  4. Define the library's classpath entries;
  5. Specify an license

Create a folder structure for the library jar and resources

The external library folder structure could follow the format bellow inside the plugin's project root:

See example bellow:

External Library folder structure.

Fill in the library's branding info

Fill in the branding fields. For this example we are using the "Lightweight User Interface Toolkit" library version 1.1.


Branding Info

Define the library's classpath entries

You MUST specify the path to the library's jar within the plug-in you are creating.

The javadoc path is optional and can be either a folder inside the plug-in or an URL. The library's source code path its also optional but if defined, it must be a folder inside the plug-in.


Classpath entries

Access rules may also be created for the classpath entry.

Specify an license

Define the license under which this library was released. You MUST provide the license name and an URL where the user can find the text of that license.


Licensing Info

Using the External Library

After the installation of the plug-in in the workbench, the new external library will be available to the user in the "New MIDlet Project" Wizard.


New Java ME Project Wizard.

In case the user select it in the New Java ME Project Wizard, the library jar will be automatically included in the project's classpath.


Project classpath.