How to include external jar file in BlackBerry Eclipse plugin

You might need to preverify the jar file. This is how you can preverify a jar file

1.Go to your JDE installation folder, for Windows XP it is usually C:\Program Files\Research In Motion\BlackBerry JDE 4.3.0\bin.

If you are using eclipse then you can also find the installation directory of BlackBerry plugin.

E:\eclipse\plugins\net.rim.eide.componentpack4.5.0_4.5.0.16\components\bin

2. Copy your jar  file to bin folder.
3. Notice the preverify.exe file. This is the tool we’ll use.
4. Now open your command prompt and change your current directory to your JDE installation directory.
5. execute the following command:
preverify -classpath “JDE_PATH_HERE\lib\net_rim_api.jar” “your_jar_filename”
6. Notice that in bin directory, another folder named output has been created. Preverified jar file resides here. Copy the preverified jar file with the same name that the non-preverified jar file has.
7. Now replace the non-preverified jar file with the verified one. Use this jar in next steps

Create a new Blackberry project with any name like LibProject.
Right-click on the project and go to Properties.
Go to Blackberry Project Properties. Click on the Application tab.
Under Project Type, change to Library.
Next, go to the Java Build Path.
go to libraries and add the jar file as an external library.
Go to Order and Export tab here, and mark your jar file as exportable
Click OK.

Build the library project.

Now, create your main BlackBerry project
Keep this projects type to as you wish it to be.
Now go to the properties of this project, In the Java Build Path, add the LibProject project as a Project dependency.

You are pretty much ready to import the jar in your code. Try to import a class and enjoy it will work 100%.

That’s all for now

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: