
Old Skool BlackBerry!
Geek time, those who are sceptical of this “technology” thing, look away now. I was supposed to post this a while ago, but have only just got round to it.
I have come into trouble getting applications to run on BlackBerry when using a third party library. Resources online for BlackBerry related stuff are quite scarce, so the top with this little post is that I will help at least somebody out! (Probably myself when I re-find this post in a Google search for “Preverifty a 3rd Party jar in BlackBerry”
This is required for all third party libraries, so read up! If you are seeing the error message:
Error starting *project name*. Module ‘jar name’ could not be found.
then this is the solution for you!
It is actually relatively easy to solve, here is how to do it:
Now, I am assuming you are programming in Eclipse, so you want to take your jar you need to preverify, and head to the bin folder of the BlackBerry JDE plugin for Eclipse. This can be found in the Eclipse folder. On my system, the bin folder will be located at:
C:\Eclipse\plugins\net.rim.ejde.componentpack*version you are using here*\components\bin
Now, drop that jar into this folder. (This just makes the whole process easier for those who don’t like dealing with the command line too much.)
Now you want to open that friendly command prompt and cd yourself to that very folder. The command:
“cd C:\Eclipse\plugins\net.rim.ejde.componentpack*version you are using here*\components\bin”
should get you there (If your Eclipse is indeed installed at C:\Eclipse, of course! Now, you want to execute a command to preverify the jar you placed in this folder. Enter this command:
preverify -classpath ”net_rim_api.jar myJarIWantToPreverify.jar
Obviously you want to change the name of the jar to the actual jar you are wanting to preverify. If you get this far and realise you have typed “myJarIWantToPreverify.jar, then please type “exit” in the command prompt, close this internet browser, and shut down the computer. I would advise not turning it on ever again!
This will prompt BlackBerry’s kit to do it’s work.
As if by magic (in fact, it is that technology thing we spoke about earlier), a folder will be created in the directory called “output”. Inside is the very jar you just plonked into the bin folder, but this version has been preverified. Congratulations. You want to drop this into your project and link it into the source, or whatever fancy thing you are planning to do with it. Take it for dinner. Any problems when you run your application should now be solved.
Note: for this to work, you will have to have your java PATH set. You should have that done already though if you are programming for BlackBerry… Shame on you if you don’t!
Hope this has helped somebody out! (ME!
)