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. In the Package Explorer view, expand the StringHandlingApp project, right-click on com.sun.jcclassic.samples.stringapp package and select Java Card and Package Settings. Select the ScriptGen tab:
    1. Select Suppress "PowerUp;" APDU command at the beginning of CAP script
    2. Click OK
  3. Repeat Step 2 for:
    • com.sun.jcclassic.samples.stringutilapp package in the same project, and
    • com.sun.jcclassic.samples.stringliblocal in the StringHandlingAppLibLocal project.
    You have modified these three packages. Next step is to build them again.
  4. Rebuild the three modified projects: select Project and Clean, and from the Clean dialog, select the three projects that you just modified.
    Eclipse builds the projects again.
  5. 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.
  6. 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.
  7. Execute the scripts in the following order:
    • cap-com.sun.jcclassic.samples.stringlib
    • cap-com.sun.jcclassic.samples.stringliblocal
    • cap-com.sun.jcclassic.samples.stringapp
    • cap-com.sun.jcclassic.samples.stringutilapp
    • stringhandlingapp
Now you can compare the console output with the contents of test.expected.output file.