Starting a Java Card simulation

Java Card applications can be tested in a simulation, which closely simulates a real card behavior. Like any other process, the Java Card simulation is launched through Eclipse's launching framework.

Note: The launch dialog and layout is different between Eclipse 3.1 and 3.2. The sample shows the Eclipse 3.2 version of the launch configuration setup. Refer to the Eclipse 3.1 documentation for details how to define launch configurations using Eclipse 3.1.

Use the following steps to create a new launch configuration and to start the Java Card simulation

  1. Select your applet in the Package Explorer View or Navigator View and open the Launch Configuration Dialog. (Run > Run)

    Open the Launch Configuration dialog
     
  2. Select Java Card Application and create a new launch configuration using the 'New' button. Then specify the name of the new launch configuration.

    Select Java Card Application
     

    The Java Card simulation launch dialog contains the following tabs:
     

    Target
    On the Target tab, you can select the target that is used for this launch configuration. A target can be either the card simulation or a connection to a card reading device. For the card simulation, you can define the connection port (default or random) using the Configure button.

     
    Package Upload

    Use the Package Upload tab to select and configure the packages to be uploaded and the applets to be installed.
    Press the Add package... button and select the package from the given list.
     

    Select packages

    Press "OK" to return to the package Upload tab.


     

    Select the package in the list and press the Install applet button to open the Install applet dialog.

    Choose the applet from the given list and press "OK". The Edit button is enabled when an applet is selected. It can be used to define specific install parameters for the applet and to define applet install properties.
     

    The following picture shows an example of the the Package Upload tab containing the information a sample package and applet:



    Package Upload tab
     
    Shell initialization
    The Shell initialization tab is used to define the JCOP Shell behaviour. You can select to either upload the package(s)/applet(s) automatically or not. In addition, you can also define the commands to be executed before and after uploading.
     
    Shell settings
    Use the Shell settings to define search paths for script execution. The settings include the option to clear the Shell buffer before starting the JC Shell.
     


     
  3. Click Run to start the simulation.
     

    The JCOP Debug perspective, including the JCOP Shell environment, will automatically open.
    The shell now automatically connects to the newly launched simulation and initiates the upload and installation process (if set in the launch configuration).

    Select packages and applets
     

Related information