views:

385

answers:

1

Hi everyone,

I'm working on a library project that Blackberry Java developers can import into their projects. It uses protected RIM APIs which require that it be code-signed, which I have done. But, I can't get my Jar imported and working with a simple helloWorld app. I'm using the eclipse plug-in Blackberry-JDE. Here is what I have tried:

First:

Building myLibProject with BlackBerry_JDE_PluginFull_1.0.0.67 into a JAR, signing it and importing it into a BlackBerry_JDE_PluginFull_1.0.0.67 application project --> I get a class not found error, while compiling the application project.

Next:

I imported myLibProject into an BlackBerry_JDE_PluginFull_1.1.1.* library project, built it into a jar, signed it and imported it into a BlackBerry_JDE_PluginFull_1.1.1.* application project. It built this time, but while loading up the simulator to test it I get the following error ( Access violation reading from 0xFFFFFFC ) before the simulator can loadup and it crashs the simulator.

Other stuff I've tried:

I also tried importing the jar into a Blackberry library project by it's self and having the HelloWorld app project reference that project.

If I include the src in my application project it works fine... But I'm looking for a way to deploy this as compiled code.

Any Ideas? Or help? Or is there a way to just compile the code to a standard jar and let the importer handle signing it?

             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
EDIT :  Solution found....   

(FYI: I use BB-ANT-TOOLS to build the SDK's jar)

A)  I had to build my SDK's jar as an 'cldc' application not as a 'library' project.  This solved most of the issues I had above.
B)  I then added an ANT task to take the resulting JAR from step A and do the following:
        * unzip it, 
        * edit the manifest file to remove the line  
          "MicroEdition-Profile: MIDP-2.0"   -- This line give an error when you try to export the jar. 
        * then re-zipped the jar.               
--
Consuming the SDK jar as an end-user
--
Then to integrate the jar in bb-eclipse you do the following:
A) Add the jar to the BuildPath
B) under "Java Build Path" on the "Order and Export" tab, Select the jar for export.  This causes rapc to build the jar into the COD file, so that you only have one COD at the end.

now when a user builds this project the jar become integrated into the final cod file, and it's very easy to deliver to the phone or sim.  

+1  A: 

Hi Eric, I am using JDE. Can you give me steps by steps instructions to import the jar file and make it run? I am facing the same issue as yours. It can be run if the source files are included in the project. If i build it as jar (library) and import it in another project, it keeps giving me errors or unwanted behavior... I'm really going insane now... Please help... It really pisses me off as a new mobile developer. I have tried almost 2 ways basically everything for that.

Why not RIM just create a clear tutorial on that instead of very ambiguous steps by steps guide? There are sooo many posts out there but none of them seem able to solve my issue.

playplay1978
Take a look at this and see if it helps: http://product.webtrends.com/DC/blackberry/mo_blackberry_jar.html#blackberryjar
eSniff
There is a bit of a learning curve if you have to learn ANT, but as far as I can tell using BB-ANT-Tools is by far the easiest solution to building jars into your project. The above linked page has a link to a sample ant file which includes building with jars. Good luck and cheers.
eSniff