Java Reference
In-Depth Information
cd output
midp HelloMidp
These commands change the current directory to the output directory containing the preverified
files and start the MIDP emulator with the new verified HelloMidp class, as shown in Figure 1.8 .
Figure 1.8. The running HelloMidp MIDlet.
In order to deploy programs that consist of multiple classes, JAR files from the desktop are used to
bundle all necessary application classes together. Fortunately, you can just jar the complete
output directory generated by the preverifier—you do not need to specify the filenames again for
jar :
jar -cf hellomidp.jar output
After you successfully create the JAR file, you need to create a Java Application Descriptor (JAD)
file. The JAD file encapsulates the information about the contents of the JAR file. In contrast to
the manifest file, the JAD file is not included in the archive. It is intended to support automatic
download of MIDlets. Listing 1.3 s hows the JAD file for the HelloMidp example MIDlet.
Listing 1.3 HelloMidp.jad —The JAD File for the HelloMidp MIDlet
MIDlet-Name: HelloMidp
MIDlet-Version: 1.0
 
 
Search WWH ::




Custom Search