Developing Removable CAP File

When a CAP file is deleted, all of its code is removed from the card's memory. A CAP file is eligible for deletion only if there are no dependencies on it, including:

  • CAP files that are dependent on the CAP file to be deleted

  • Applet instances or objects that either belong to the CAP file, or that belong to a CAP file that depends on the CAP file to be deleted

CAP file deletion will not succeed if one of the following conditions applies:

  • A reachable instance of a class belonging to the CAP file exists on the card

  • Another CAP file on the card depends on the CAP file

  • A reset or power failure occurs after the deletion process begins, but before it completes

To ensure that a CAP file can be easily removed from the card, avoid writing and downloading other CAP files that might be dependent on it. If other CAP files on the card depend on it, you must remove all dependent CAP files before you can remove this CAP file from the card memory.