Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does preverification of J2ME application mean?

Tags:

java

java-me

I read the following:

J2ME applications, unlike normal Java applications are preverified.

What exactly does the preverification of J2ME jar file mean? Is it something like checksum?

like image 542
gameover Avatar asked Jan 04 '10 16:01

gameover


1 Answers

From here:

Answer Preverification is a new phase in the development and deployment cycle for Java applications designed to run on the J2ME CLDC. Preverification performs certain checks on the Java bytecodes ahead of runtime. If this first verification pass is ok, the preverifier annotates the classfiles (using standard Java bytecode "attributes", so that these are still plain old Java bytecodes and will be executable in VMs not aware of the benefits of preverification), and then saves the annotated class files or passes them along to the next tool in the compile chain.

When the KVM attempts to run execute a J2ME CLDC-based application, it checks the Java class files for these preverification annotations. Proper annotations in the class files guarantee that certain compile-time checks were made, and so the KVM can pass through its own verfication and security checks much faster and start executing the application more quickly.

Sun's CLDC reference implementation SDK includes the 'preverify' tool. You use the tool after compiling your code via javac (or your favorite Java compiler). More information on preverify is included in the CLDC specification and in the developer docs included with the CLDC SDK.

like image 139
Ravi Wallau Avatar answered Sep 20 '22 12:09

Ravi Wallau