Running the StringHandlingApp Sample from Eclipse

The StringHandlingApp sample consists of three Java Card projects: StringHandlingApp, StringHandlingAppLib, and StringHandlingAppLibLocal.

Start Eclipse. Sample_Platform and Sample_Device must already be created.
  1. Import the following Java Card projects into your workspace: StringHandlingApp, StringHandlingAppLib, and StringHandlingAppLibLocal. If the builds don't start automatically, start them manually.
    About the build order: the StringHandlingApp project depends on both StringHandlingAppLib and StringHandlingAppLibLocal. StringHandlingAppLibLocal depends on StringHandlingAppLib. These dependencies define the order in which the projects are built by Eclipse: first StringHandlingAppLib, then StringHandlingAppLibLocal, and finally StringHandlingApp. In the StringHandlingApp project, the packages are built in order of their AID values: first com.sun.jcclassic.samples.stringapp, then com.sun.jcclassic.samples.stringutilapp.
  2. Perform the following steps for the StringHandlingApp project:
    1. In the Package Explorer view, click the StringHandlingApp 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 StringHandlingApp1 and select Edit.
    5. In the Edit mode, select Compact CAP File.
    6. Click Next>.
    7. 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.
    8. Click Finish.
    9. Repeat Steps a to c.
    10. Click StringHandlingApp2 and select Edit.
    11. Repeat Steps e to g.
    12. Click Finish, and select Apply and Close.
  3. Perform the following steps for the StringHandlingAppLib project:
    1. In the Package Explorer view, click the StringHandlingAppLib 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 StringHandlingAppLib and select Edit.
    5. In the Edit mode, select Compact CAP File.
    6. Click Next>.
    7. Select ScriptGen slide and select the Supress "PowerDown; APDU command at the end of CAP script check box.
    8. Click Finish, and select Apply and Close.
  4. Perform the following steps for the StringHandlingAppLibLocal project:
    1. In the Package Explorer view, click the StringHandlingAppLibLocal 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 StringHandlingAppLibLocal and select Edit.
    5. In the Edit mode, select Compact CAP File.
    6. Click Next>.
    7. 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.
    8. Click Finish, and select Apply and Close.
  5. Rebuild the modified projects: select Project and Clean, and from the Clean dialog, select the three projects that you just modified.
    Eclipse builds the projects again.
  6. 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.
  7. In Java Card View, right-click on Sample_Device and select Start.
    The simulator starts and you can see that Sample_Device console is created.
  8. Execute the scripts in the following order:
    • cap-StringHandlingApp
    • cap-StringHandlingAppLibLocal
    • cap-StringHandlingApp1
    • cap-StringHandlingApp2
    • stringhandlingapp
Now you can compare the console output with the contents of test.expected.output file.