0

I have also asked this question on the BlackBerry support forums, under the thread "NoClassDefFoundError while preverify the jar files in BlackBerry"

I am adding a library files(jar files) in my BlackBerry Project and and try to run it. But it is giving me the below error : Error!: Missing stack map at label 77. So i try to find out the issue and find this link: Preverify Link

So i tried to fix this issue using preverifier. As i am using BlackBerry eclipse plugin, i have tried in this way:

  1. Copy the jar file in the bin folder of my eclipse 6.0 plugins (eclipse-SDK-3.5.2-win32\eclipse\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.29\components\bin)
  2. Execute the following command in the command line:

     preverify -classpath "<path to 6.0.0.29 SDK>\net_rim_api.jar" "ArcotOTP-Lib-Java-Test-2.0.0.jar"
    

But after running this line, i am getting the below error:

Error preverifying class Mypackage.API$1
java/lang/NoClassDefFoundError: Mypackage/Test
Michael Donohue
  • 11,776
  • 5
  • 31
  • 44
Arindam Mukherjee
  • 2,255
  • 11
  • 48
  • 83

1 Answers1

2

BlackBerry devices are running on the Java-ME platform, so you can't use modern java features. Typical Java jar files these days use newer features that are not backward compatible with the Java-ME platform. Some projects do go out of the way to be backward compatible, like Bouncy Castle. But that is rare.

This question, duplicated on the BlackBerry forums, was also answered on the BlackBerry forums, which I will capture here:

simon_hain:

and is it a j2me library?

Arindam Mukherjee:

No it is java library..all classes are basically java classes. The same library i am using for android also and it is working fine fro me..

simon_hain:

BlackBerry uses J2ME as a base, Android uses J2SE. You cannot use an Android library on BlackBerry unless you re-compile it (and resolve all the errors due to missing reflection, lists etc)

Michael Donohue
  • 11,776
  • 5
  • 31
  • 44