Running the Utility Sample from the Command Line
To run the Utility sample:
-
Open a Command Prompt window and perform the following:
-
Navigate to the
JC_HOME_SIMULATOR\bindirectory. -
Start the simulator by entering the following command at the command prompt:
crefNote:
crefcommand options are not required in this sample.
-
-
Open a second Command Prompt window and perform the following:
-
Set
ANT_HOME(path to ant install folder),JC_HOME_TOOLSandJC_HOME_SIMULATOR(path to JCDK install folder) as environment variables. -
Navigate to the
JC_HOME_SIMULATOR\samples\classic_applets\Utility\appletdirectory. -
Enter the
antallcommand at the command prompt.In this sample, the
antallcommand builds the applet, executes the APDU script, and creates an output file in theappletdirectory. The ant script names the output file eitherdefault.outor the custom name specified in the command line. To specify a custom name for the output file, use the following command:ant-Dredirect.output=outputfile_name targetIn this command, outputfile_name represents the name of the output file and target represents either the
allorrunoptions of theantcommand. In this case, thealltarget is used. This command redirects the output from the APDUtool execution to the outputfile_name file.
-
-
Verify that the contents of the output file in the
appletdirectory are the same as the contents of theutility.expected.outfile.