Running the JavaPurseCrypto Sample in Eclipse

Start Eclipse. Sample_Platform and Sample_Device must already be created.
  1. Import the JavaPurseCrypto project into your workspace.
    If the build doesn't start automatically, start it manually.
  2. Select the JavaPurseCrypto project, press Alt+Enter, select Run/Debug Settings, and click New. In the Select Configuration Type window select Java Card Project Run and click OK.
  3. Before you start any script, you must change the PowerDown and PowerUp parameters for generating the script files. Otherwise, the simulator goes into the PowerDown mode or interrupt the execution by throwing error messages. To change the PowerDown parameters:
    1. In the Package Explorer view, click JavaPurseCryptoJava project.
    2. Right-click on the Java Card project and select Java Card and CAP Files Settings.
    3. Select a CAP file from the list that appears in the Java Card CAP Files page.
    4. Click SampleLibrary and select Edit.
    5. In the Edit mode, select Compact CAP File.
    6. Click Next>.
    7. Select ScriptGen slide and select the Suppress "PowerDown;" APDU command at the end of CAP script check box.
    8. Click Finish.
    9. Click JavaLoyality and select Edit.
    10. In the Edit mode, select Compact CAP File.
    11. Click Next>.
    12. Select ScriptGen slide and select the Supress "PowerUp; APDU command at the beginning of CAP script and Supress "PowerDown; APDU command at the end of CAP script check boxes.
    13. Click Finish.
    14. Click JavaPurse and select Edit.
    15. In the Edit mode, select Compact CAP File.
    16. Click Next>.
    17. Select ScriptGen slide and select the Supress "PowerUp; APDU command at the beginning of CAP script and Supress "PowerDown; APDU command at the end of CAP script check boxes.
    18. Click Finish and select Apply and Close.
  4. In the Edit Configuration window do the following:
    1. Enter JavaPurseCrypto in the Name field
    2. Select the Start simulator checkbox
    3. Add the following scripts to the listbox:
      • cap-SampleLibrary.script

      • cap-JavaLoyalty.script

      • cap-JavaPurse.script

      • jpcrypto.scr

    4. Click Apply and OK to close the Edit Configuration window.
    5. Click OK to close the Properties window.
  5. In the Java Card View, double-click Sample_Device. In the Properties for Sample_Device dialog, select the CREF tab:
    1. Select Do not open APDU console.
    2. Click OK.
  6. Select Run and Run Configurations. Select JavaPurse then click Run.
    Compare the console output with the content of javapursecrypto.expected.output file.