Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
arindamhit
Posts: 271
Registered: ‎12-24-2010
My Device: BlackBerry 10
My Carrier: Airtel

NoClassDefFoundError while preverify the jar files in BlackBerry

[ Edited ]

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

 

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:

     

    D:\eclipse-SDK-3.5.2-win32\eclipse\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.29\components\bin>preverify -classpath "D:\eclipse-SDK-3.5.2-win32\eclipse\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.29\components\lib\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

     

    I have check many links. and tried on the different way. But still i am getting the same error.

    Need Help..

 

Please use plain text.
Developer
simon_hain
Posts: 16,113
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: NoClassDefFoundError while preverify the jar files in BlackBerry

and is it a j2me library?
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
arindamhit
Posts: 271
Registered: ‎12-24-2010
My Device: BlackBerry 10
My Carrier: Airtel

Re: NoClassDefFoundError while preverify the jar files in BlackBerry

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..

Please use plain text.
Developer
simon_hain
Posts: 16,113
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: NoClassDefFoundError while preverify the jar files in BlackBerry

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)
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
arindamhit
Posts: 271
Registered: ‎12-24-2010
My Device: BlackBerry 10
My Carrier: Airtel

Re: NoClassDefFoundError while preverify the jar files in BlackBerry

No we have a different BlackBerry Library also which i am using for other functionalities. But this a Java library which we are using to print to authenticate some tokens and test the user credentials. 

Please use plain text.
Developer
peter_strange
Posts: 19,603
Registered: ‎07-14-2008
My Device: Not Specified

Re: NoClassDefFoundError while preverify the jar files in BlackBerry

[ Edited ]

Instead of trying to add the jar, you could try adding all the java files separately to a new BB project.  Attmept to compile that.  It will quickly tell you what is not supported, if anything. 

Please use plain text.
New Contributor
GangaNaidu
Posts: 2
Registered: ‎01-25-2013
My Device: curve 8520
My Carrier: Airtel

Re: NoClassDefFoundError while preverify the jar files in BlackBerry

Hi 

  I am trying add ksoap lib its gving same error ..what sholud i do..and how to add ksoap library in blackberry 

Please use plain text.
Developer
simon_hain
Posts: 16,113
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: NoClassDefFoundError while preverify the jar files in BlackBerry

please open your own thread for your issue, but better search the forums first as the question should have been answered a few times already.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.