Using Export Files

A Java Card technology-based export file contains the public API linking information of classes in an entire package. The Unicode string names of classes, methods and fields are assigned unique numeric tokens.

Export files are not used directly on a device that implements a Java Card virtual machine. However, the information in an export file is critical to the operation of the virtual machine on a device. An export file is produced by the Converter when a package is converted. You can use this package's export file later to convert another package that imports classes from the first package. Information in the export file is included in the CAP file of the second package, then is used on the device to link the contents of the second package to items imported from the first package.

During the conversion, when the code in the currently converted package references a different package, the Converter loads the export file of the different package. The Converter also tries to load the shareable interface class files being imported from that package.

For more information on export files, see Verifying CAP and Export Files .

Calls Between Packages Go Through the Export Files illustrates how an applet package is linked with the java.lang, the javacard.framework and javacard.security packages through their export files.

You can use the -exportpath command option and the exportPath JSON field to specify the locations of export files and the shareable interface class files. The path consists of a list of root directories in which the Converter looks for export files and shareable interface class files. Export files must be named as the last portion of the package name followed by the extension .exp. Export files are located in a subdirectory called javacard, following the relative directory path that matches the package name. The shareable interface class files are located in the relative directory path that matches the package name.

For example, to load the export file of the package java.lang, if you have specified -exportpath as c:\myexportfiles, the Converter searches the directory c:\myexportfiles\java\lang\javacard for the export file lang.exp.

Figure 4-1 Calls Between Packages Go Through the Export Files


Calls Between Packages Go Through the Export Files