Welcome!

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

Reply
Highlighted
New Developer
Posts: 8
Registered: ‎05-12-2009
My Device: Not Specified
Accepted Solution

Trying to include external jar in Eclipse IDE, but it's not working

Hi everyone,

 

I am trying to use the BB plugin for Eclipse.  I have seen other posts along the same lines as mine, but nothing seems to resolve the issue or the person was referring to an older version of the plugin.  I am trying include a jar file named J2meMap_lib_cldc11.jar.  Here is what I have done so far:

 

I created a new Blackberry project named J2MEMap.

I right-click on the project and go to Properties.

I go to Blackberry Project Properties. Click on the Application tab.

Under Project Type, change to Library.

 

Next, I go to the Java Build Path.

I go to libraries and add the jar file as an external library.

Click OK.

 

Next, I create a new Blackberry Project named MyApp.

For this one, I make it a Midlet.

In the Java Build Path, I add the J2MEMap project as a Project dependency.

 

First thing I notice is that MyApp has compile errors because it doesn't seem to find the jar file in the other project.  If I look in the Blackberry Builder Console, I see the following error when I try to build the J2MEMap project:

 

C:\programs\opensource\eclipse\plugins\net.rim.eide.componentpack4.5.0_4.5.0.16\components\bin\launcher.exe C:\programs\opensource\eclipse\plugins\net.rim.eide.componentpack4.5.0_4.5.0.16\components\bin\rapc.exe  -quiet import=..\..\..\..\..\..\programs\opensource\eclipse\plugins\net.rim.eide.componentpack4.5.0_4.5.0.16\components\lib\net_rim_api.jar;..\..\..\..\..\..\programs\opensource\j2memap\sdk\cldc11\J2meMap_lib_cldc11.jar library=..\J2MEMap\J2MEMap warnkey=0x52424200;0x52435200;0x52525400 -sourceroot=C:\Local\develop\eclipse\workspaces\psu\J2MEMap\src C:\Local\develop\eclipse\workspaces\psu\J2MEMap\bin
Error!: No classes found
rapc failed for the project J2MEMap

 

Previously, I was not getting this error, but I started getting it for some reason.  I am able to build the sample Midlet that comes with the JDE and deploy and run it on the simulator.  For some reason, I just can't get libraries to work correctly.

 

Thanks,

Eric

New Developer
Posts: 8
Registered: ‎05-12-2009
My Device: Not Specified

Re: Trying to include external jar in Eclipse IDE, but it's not working

Sorry for the post.  I was able to figure it out on my own.  I deleted both projects and re-created them using those same steps and it is working now.  The only thing I may have done differently is that I restarted Eclipse after I created the project holding the jar file.

 

Thanks,

Eric

New Developer
Posts: 8
Registered: ‎05-12-2009
My Device: Not Specified

Re: Trying to include external jar in Eclipse IDE, but it's not working

Actually, I figured I would answer my own question in case someone else has the same problem.  In the library project, I needed to go to the Project properties and go to the Import/Export, then select the external jar file as one of the components that need to be exported.

 

Thanks,

Eric

Developer
Posts: 137
Registered: ‎09-30-2009
My Device: Torch 9800

Re: Trying to include external jar in Eclipse IDE, but it's not working

Hi

Your post helped me.

At first what I was missing that we need to select the jar file to be exported as marked in Order and Export tab. After clicking that everything went well. Do you think that this will also work in device without any problem? I have little experience in here.

 

Thanks

Shimul 

----------------------
Press like if you find a message helpful
---------