03-15-2010 08:09 AM
I would like to know how to create a .JAR file from http://www.json.org/java/org.json.me.zip . I want to be able to add it as a JAR file instead of adding adding all the classes to the project directly. Could someone help me.
I tried various methods with no success. The preverify kept failing.
Solved! Go to Solution.
03-15-2010 10:32 AM
You could create a Library project and import the classes there then build. Once built, a jar will be generated for the new project. You could then include it in any of your future projects.
If you're using Eclipse let me know. I barely use the JDE now so I don't remember where everything is.
03-15-2010 10:38 AM
Thanks for your reply. Yes I do use eclipse. I did that, but for some reason when I tried to preverify it, it didn't work. I also tried to directly adding the jar file by create a new blank bb project, setting the properties to Library, and then setting it as a dependancy in my actual project. But even though all my errors went, when I run the simulator the app doesn't show. I'm sure I'm doing something really foolish, will mess around a little more.
03-15-2010 11:26 AM - edited 03-15-2010 11:27 AM
Make sure that your projects are using similar compliance levels. Also try cleaning and rebuilding your project. Since the project is now a BlackBerry library, try just adding a reference to the library project in the main project instead of directly adding the JAR.
From then on, when you package your project, your library project is automatically added to the simulator. When you deploy to a real device, it becomes a different story. If you are deploying over the air, you need to update your JAD file to include references to the library cod file.
You can use the UpdateJad executable found in the bin folder of one of your component packs to do this. Just do:
updatejad Main.cod Library.cod
And it will do the rest for you (even create a backup of the old JAD). You'd need to make sure to either give the full paths to each cod or run updatejad on a folder that contains all necessary COD files.
If you're using Desktop Manager, I believe the dependences are added to the ALX automatically and you just have to copy the library cod file in (not 100% on this though.
Long-winded post but hopefully it helps others.
02-07-2011 07:39 AM
I am working on an app that required a webservice consumption.I successfully add ksoaplibrary jar file to my project and get the response
I Know this is json object .But the problems starts here b'coz i am not able to add json.jar to my project.I tried for this but then my app have'nt appear in the simulator
Plz help me
how to add json.jar
Or how i can parse this response
02-07-2011 10:48 AM
Welcome to the forum.
Please don't post on solved Threads. If you have a new problem, please start a new Thread.
If you search the forum you will find other people have talked about including JSON in their projects, I suspect one of these Threads will resolve hour problem too. So use the Search facility to look for more information.
02-08-2011 03:59 AM
"how to start a new thread"
When you are looking at the list of Threads, there is a 'new' button at the top left hand side of the list.
In addition, there is help link near the top, press on that and you will find loads of useful information.
03-25-2011 12:28 PM
thanks for this tip : updatejad Main.cod Library.cod
but now i am wondering how to to build a lib which depends on json jar and make the app link w/ my lib.jar and json.jar , can this be done a simple way ?