08-31-2011 03:23 AM
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.
Solved! Go to Solution.
08-31-2011 09:47 AM - edited 08-31-2011 10:49 AM
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.
09-02-2011 05:55 AM
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.
09-02-2011 08:56 AM
My pleasure to help!