Java Application Descriptor (JAD) essentials
This article provides an overview of the Java Application Descriptor (JAD) including a list of the mandatory and optional attributes.
Reasons: hamishwillee (27 Mar 2013)
This article should be merged with articles containing similar material: JAD, JAR, Java Application Descriptor (JAD) essentials, MIDlet JAR Manifest essentials
Article Metadata
Contents |
Introduction
Each JAR file MAY be accompanied by an application descriptor (JAD - Java Application Descriptor). JAD is used in conjunction with the JAR manifest by the application management software to manage the MIDlet and is used by the MIDlet itself for configuration specific attributes. The descriptor allows the application management software on the device to verify that the MIDlet is suited to the device before loading the full JAR file of the MIDlet suite. It also allows configuration-specific attributes (parameters) to be supplied to the MIDlet(s) without modifying the JAR file.
To allow devices to dispatch an application descriptor to the MIDP application management software, a file extension and MIME type are registered with the IANA:
- The file extension of an application descriptor file is .jad
- The MIME type of an application descriptor file is text/vnd.sun.j2me.app-descriptor.
A predefined set of attributes is specified to allow the application management software to identify, retrieve, and install the MIDlet(s). All attributes appearing in the descriptor file are made available to the MIDlet(s). The developer may use attributes not beginning with MIDlet- or MicroEdition- for application-specific purposes. Attribute names are case-sensitive and MUST match exactly. An attribute MUST NOT appear more than once within the manifest. If an attribute is duplicated the effect is unspecified. The MIDlet can retrieve attributes by name by calling the MIDlet.getAppProperty() method.
For more information on signing and Java verfied see this FAQ. In particular topics "Signing Java ME applications" and "Why doesn't my signed midlet work?"
Must Have Attributes
The JAD must contain the following attributes:
- MIDlet-Name :The name of midlet/midletsuite
- MIDlet-Version :The version info for the MIDlet
- MIDlet-Vendor :The vendor of the MIDlet
- MIDlet-Jar-URL :The absolute URL at which the JAR is available for download
- MIDlet-Jar-Size :The Size of the jar file
May Have Attributes
The JAD might or might not contain the following attributes:
- MIDlet-<n> for each MIDlet :The name, icon, and class of the nth MIDlet in the JAR file separated by a comma. The lowest value of <n> MUST be 1 and consecutive ordinals MUST be used. The first missing entry terminates the list. Any additional entries are ignored. Leading and trailing spaces in name, icon and class are ignored.
- MicroEdition-Profile :The MIDP version profile being used, eg. MIDP1.0
- MicroEdition-Configuration :The Configuration being used, eg. CLDC1.0
- MIDlet-Description :Usually a short discription about the MIDlet
- MIDlet-Icon :Its the absolute name of a PNG file within the JAR used to represent the MIDlet suite. It is the icon that the AMS(Application Management Software) displays
- MIDlet-Info-URL :A URL for information describing the MIDlet suite.
- MIDlet-Data-Size :The data storage size that can be used, eg. 1024
- MIDlet-Permissions :Zero or more permissions that are critical to the function of the MIDlet suite.
- MIDlet-Permissions-Opt :Zero or more permissions that are non-critical to the function of the MIDlet suite.
- MIDlet-Push-<n> :Register a MIDlet to handle inbound connections.
- MIDlet-Install-Notify : The URL to be notified after installation of MIDlet
- MIDlet-Delete-Notify : The URL to be notified after deletion of MIDlet
- MIDlet-Delete-Confirm: Confirmation message to be displayed before deletion of MIDlet
- Any application-specific attributes that do not begin with MIDlet- or MicroEdition- which can be read later in code
Links
http://developers.sun.com/mobility/learn/midp/lifecycle/#jadsnjars


30 Sep
2009
This article provides a useful discussion of the role of JAD (Java Application Descriptor) files in Java ME applications. These files allow us to specify various configuration parameters separately from the JAR installation files. The article gives a brief overview of the role of JAD files. The different possible attributes are categorized according to whether they are optional or mandatory attributes.
The article provides a useful resource for looking up the different attributes to be found in JAD files and their roles. Having said that, the article appears to merely be a subset of the information contained in the Javadoc page which readers can link to from the bottom of the article. Generally, it is better for beginners to avoid editing JAD files directly, and rather to edit the attributes through the interface provided by IDEs such as NetBeans and Eclipse.