Building and Running the Samples from the Command Line

All available Java Card samples are located under the JC_HOME_SIMULATOR\samples directory. Each sample resides in a subdirectory and consists of its own set of batch/shell script files for creation and execution on Windows and Linux.

Important: The batch/shell script files in the JC_HOME_SIMULATOR\samples directory are shared components used by the scripts in each sample application's subdirectory. These files are not intended to be executed directly.

How to build and run a sample:

  1. In a command prompt, navigate to the desired sample directory and execute build.bat or ./build.sh depending on your operating system, to build all necessary modules.
  2. In a separate command prompt, start the Java Card Simulator by running the executable, depending on your operating system:
    • %JC_HOME_SIMULATOR%\runtime\bin\jcsw.exe
    • ${JC_HOME_SIMULATOR}/runtime/bin/jcsl
  3. In a sample application's subdirectory, execute the run script.
    • By default, running run.bat or ./run.sh (depending on your operating system) connects to the Simulator using its internal socket interface.
    • On Windows, if you have installed the optional Oracle Java Card PCSC Driver, a sample can communicate indirectly with the Simulator through the PCSC driver. To use this driver, include the pcsc parameter with the virtual card reader's name to be used:
      run.bat "pcsc:Oracle Java Card PCSC Reader 0"

      Refer to Windows – Install and Set Up the PCSC Driver (optional) for additional information.

    • On Linux, if you have installed the optional PCSC-Lite and IFDHandler (see Linux - Install and Set Up the PCSC-Lite and IFD Handler), a sample can communicate indirectly with the Simulator through PCSC-Lite. To use this driver, include the pcsc parameter with the virtual card reader's name to be used:
      ./run.sh "pcsc:Oracle_Java_Card_PCSC_Reader_0 00 00"

      Note:

      Since the name of the virtual card reader may contain spaces, you must enclose the entire name (including the leading ”pcsc:” string) in double quotation marks.