Running the Wallet Sample in Eclipse

These instructions use clipboard operations and the APDU console to run the script. You could instead run the script in the usual way (right-click the script, select Java Card and Execute Script).

Start Eclipse. Sample_Platform and Sample_Device must already be created.
  1. Import the Wallet Java Card project into your workspace. If the build doesn't start automatically, start it manually.
    The build creates apdu_scripts and deliverables directories.
  2. In Java Card View, double-click on Sample_Device. In the Properties for Sample_Device dialog, select the CREF tab:
    1. Clear the Input file with EEPROM data, the Output file for EEPROM data, and the Combined (input and output) file for EEPROM data fields.
    2. Clear Do not open APDU console.
    3. Click OK.
  3. Before you start any script, you must change the PowerDown parameters for generating the script files. Otherwise, the simulator goes into the PowerDown mode after running the cap-Wallet.script. To change the PowerDown parameters:
    1. In the Package Explorer view, click the Wallet Java 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 Wallet 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 and select Apply and Close.
  4. In Java Card View, right-click on Sample_Device and select Start.
    The simulator starts and you can see the output in the Sample_Device console view. The output ends and the CMD> prompt is displayed.
  5. In the console toolbar, click on the Select script drop-down button and select cap-com.sun.jcclassic.samples.wallet from the list.
    The script is submitted to the simulator and you can see the output.
  6. In Package Explorer, expand the apdu_scripts folder and double-click on wallet.scr to open it in the editor view. Select all text in the editor view, copy it to the clipboard, and paste it into the Sample_Device console.
    The script is executed by the simulator, and you see the output in the Sample_Device console.
Compare the output with the contents of the wallet.expected.out file.