Setting Up the Optional Ant Tasks

The following XML must be added to your build.xml file to use the optional Ant tasks in your build.

<!-- Definitions for tasks for Java Card tools --> 
<taskdef name="apdutool"   
  classname="com.sun.javacard.ant.tasks.APDUToolTask" /> 
<taskdef name="capgen"   
  classname="com.sun.javacard.ant.tasks.CapgenTask" /> 
<taskdef name="maskgen"   
  classname="com.sun.javacard.ant.tasks.MaskgenTask" /> 
<taskdef name="deploycap"   
  classname="com.sun.javacard.ant.tasks.DeployCapTask" /> 
<taskdef name="exp2text"   
  classname="com.sun.javacard.ant.tasks.Exp2TextTask" /> 
<taskdef name="convert" 
  classname="com.sun.javacard.ant.tasks.ConverterTask" /> 
<taskdef name="verifyexport" 
  classname="com.sun.javacard.ant.tasks.VerifyExpTask" /> 
<taskdef name="verifycap" 
  classname="com.sun.javacard.ant.tasks.VerifyCapTask" /> 
<taskdef name="verifyrevision" 
  classname="com.sun.javacard.ant.tasks.VerifyRevTask" /> 
<taskdef name="scriptgen" 
  classname="com.sun.javacard.ant.tasks.ScriptgenTask" /> 
<typedef name="appletnameaid" 
  classname="com.sun.javacard.ant.types.AppletNameAID" /> 
<typedef name="jcainputfile" 
  classname="com.sun.javacard.ant.types.JCAInputFile" /> 
<typedef name="exportfiles" 
  classname="" />

Library Dependencies

Table B-1 shows the libraries that are needed in your classpath if you are using the indicated feature. Alternatively, you can specify the classpath nested element for each task to put the required JAR files in the classpath during build execution.

Table B-1 Library Dependencies

Libraries Features

converter.jar and offcardverifier.jar

Creating CAP, EXP or JCA files.

Using maskgen to create a mask.

Dumping contents of an EXP file in a text file.


Verifying EXP files, CAP files and verifying binary compatibility between two versions of an export file.

apdutool.jar and apduio.jar

Sending an APDU script to cref.


Dumping contents of a CAP file.


Generating an APDU script from a CAP file.

apdutool.jar, apduio.jar and scriptgen.jar

Installing a CAP file in cref and generate resulting EEPROM image.