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
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.
Joined: Feb 21, 2002
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 ?