• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

preverification of classes extracted from jar

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy,
Does anyone know if classes that are extracted from a jar file need to be preverified again ?
I'm trying to write a library and, as you can't include a jar file with MIDP classes, I guess that the easiest way to link the library code with existing code is to extract classes from a jar file, add the extracted folder to the classpath to compile and munge the whole lot together in a jar so that it can be loaded onto the phone.
Only problem with this is that the library classes cause a verification error to occur on the phone.
If I do exactly the same thing but skipping the initial jaring the Library step (e.g. just copy the classes across to the project using the "library") then all is ok.
In summary, does anyone know how to create a jar file containing classes that can be extracted and used without re-preverifying them ?
Cheers,
Jeremy
 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maybe i misunderstood, but all classes need to be preverified before execution because the verifier in the device will be looking for stack map attributes in the preverified classes. so why not first preverify the classes that you can then insert into the jar? you can then remove them later. preverified classes will work fine with the J2SE VM.
 
Jeremy Thornton
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My initial testing showed the following (I think).
1) Preverified classes can be copied across to a new project, added to the classpath and then jared up as normal. As expected this works ok.
2) if the preverified classes are jared and then unjared in the new project and the above step carried out then the phone complains that they are bogus.
Seems like it's the jaring stage that distorts preverified classes.
has anyone else tried this at all ?
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With my MIDP class libraries, I don't preverify them, and I distribute a JAR. The developer using the library will preverify the classes when building his or her MIDlet.
 
Jeremy Thornton
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Liam,
Just wanted to make sure I wasn't missing anything obvious.
 
So you made a portal in time and started grabbing people. This tiny ad thinks that's rude:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic