Finally I wrote the script to all the J2ME processes. For creating the JAD I've written the follwoing
**<target name="makeJAD">
<length file="${prototype}/bin/${PROGRAM_NAME}.jar" property="jarSize"/>
<echo file="${prototype}/bin/${PROGRAM_NAME}.jad">MIDlet-Jar-Size: ${jarSize}
MIDlet-1: ${PROGRAM_NAME},,${PACKAGE_NAME}.${PROGRAM_NAME}
MIDlet-Jar-URL: ${PROGRAM_NAME}.jar
MIDlet-Name: ${MIDLET_NAME}
MIDlet-Vendor: ${MIDLET_VENDOR}
MicroEdition-Configuration: ${CONFIG}
MicroEdition-Profile: ${PROFILE}
MIDlet-Version: ${MIDLET_VERSION}
</echo>
</target>**