Running the Service Sample from the Command Line
To run the Service sample:
-
Open a Command Prompt window and perform the following:
-
Navigate to the
JC_HOME_SIMULATOR\bin
directory. -
Start the simulator by entering the following command at the command prompt:
cref
Note:
cref
command 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_TOOLS
andJC_HOME_SIMULATOR
(path to JCDK install folder) as environment variables. -
Navigate to the
JC_HOME_SIMULATOR\samples\classic_applets\Service\applet
directory. -
Enter the
ant
all
command at the command prompt.In this sample, the
ant
all
command builds the applet, executes the APDU script, and creates an output file in theapplet
directory. The ant script names the output file eitherdefault.out
or 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
all
orrun
options of theant
command. In this case, theall
target 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
applet
directory are the same as the contents of theservice.expected.out
file.