I got this error when I included guava-11.0-rc1.jar which contains the package com.google.common.* . But when I try to package it, it gives me the error:
Error preverifying class com.google.common.collect.Ordering MyApp line 0
BlackBerry Packaging Problem
Can anybody tell me what can be done to solve this? Thanks in advance.
Make sure the classes in that library are Java-ME compatible. Remember CLDC is a subset of Java SE and the equivalent desktop compilation level would be 1.2
If they were compatible, then to solve the preverification error you must first preverify your jar. You might be wondering what preverification is. There’s a good explanation in this answer.
Preverification is usually done (or should be done) by the Eclipse plugin, but some versions do not. If this is your case, you should do it manually. In your JDE folder, there is a tool called
preverify. You could find it in a path that typically looks like this in a Windows machine:You’ll also need a library called
net_rim_api.jarlocated in a path like this:This is all you need to launch the command. Open command line and change dir to the bin folder (1). Then type :
Where:
<classpath for lib>is the path in (2)<output directory>is the directory where the preverified jar will be saved.<file to preverify>is the absolute path to the file you want to preverify (guava-11.0-rc1.jar in your case)If everything went well, now you’ll have a new jar in
<output directory>which is slightly bigger than the input jar file. This is the one you should include in your project. Thepreverifytool does not change your original jar.