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
Contributor
bulli19
Posts: 24
Registered: ‎01-27-2011
My Device: Not Specified
Accepted Solution

Java Built Path libraries problems. Using an external JAR as a library in a BlackBerry app.

Hello,

 

I have two codes, the application code and the library code.

 

The application has to use the jar file as a library.

 

Aplication -> App

Library -> AppLib

 

I'm working with Eclipse and JRE 5.0. I have a problem. I'm putting the "AppLib.jar" in the the Java Build Path of application code, like in a normal Java application. Copy "AppLib.jar" into my project and select in Java Build Path libraries doesn't work. The files browser doen't show me the new file. Therefore, I can select from library project folder as External JAR, but when I test the application on the BlackBerry I get an error about not finding the module:

 

>> Error starting App: Module 'AppLib' not found <<

 

To export my app to the BlackBerry I only select the "App.alx" file with the Desktop Manager. Should I also add, somehow, the Jar file?

 

What am I doing wrong?

 

I think if I could include "AppLib.jar" as no external JAR to compile the project would be provided for this library correctly in the "App.alx" but as I've said, if for example I put the "AppLib.jar" in the "App\ lib\" folder the build path file browser doesn't show me the file and I can't select it. I can only do it if I select at AppLib\deliverables\Standard\5.0.0\ but then the Not Found Problem occurs.

 

Anybody can help me?

 

I do not want to put the code of my library into the application code. That would not be very comfortable. And it would be a bit dodgy.

 

Thank you very much.

 

 

Developer
ibarrera
Posts: 588
Registered: ‎05-29-2009
My Device: 9100

Re: Java Built Path libraries problems. Using an external JAR as a library in a BlackBerry app.

I think you should also select your library in the Order and Export tab.
Developer
johanguzman07
Posts: 102
Registered: ‎07-26-2011
My Device: Not a blackberry user

Re: Java Built Path libraries problems. Using an external JAR as a library in a BlackBerry app.

[ Edited ]

Greetings.

 

ibarrera, that's not the problem.

 

First of all, when copy a file to your project via operating system explorer, you have to refresh the project in Eclipse in order to get it visible; otherwise, if Eclipse does not see it, the .jar file is not going to be attached to your project. But I know this is not the problem.

 

Second, to get that .jar file be included in your project as non external, you have to add it as external first, close that Properties wizard open it again; then, select the .jar file you just added and click "Migrate JAR file" button. Browse to the .jar file in the project and click finish.

 

With that done, your project will be ready to be built and run.

 

I Hope this help. Good luck at all.


Let me know if this was helpful or if you have a solution.

Johan Guzmán - In case my answer pleased you, give a press to the LIKE button, please!! Mark this post as solution if it solved your problem.
Contributor
bulli19
Posts: 24
Registered: ‎01-27-2011
My Device: Not Specified

Re: Java Built Path libraries problems. Using an external JAR as a library in a BlackBerry app.

Thank you very much Johan, thats's worked.

I've had to include the lib project in Built path Projects to, and now the library appears inside my code as a part of that. But it's more comfortable than export both projects by separete.

 

Thanks.

Developer
johanguzman07
Posts: 102
Registered: ‎07-26-2011
My Device: Not a blackberry user

Re: Java Built Path libraries problems. Using an external JAR as a library in a BlackBerry app.

My pleasure to help! :Batman:


Let me know if this was helpful or if you have a solution.

Johan Guzmán - In case my answer pleased you, give a press to the LIKE button, please!! Mark this post as solution if it solved your problem.