Java Card 3 Platform Development Kit User Guide, Classic Edition
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.
- 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.
- 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:- Select Suppress "PowerUp;" APDU command at the beginning of CAP script
- Click OK
- 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.
- 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.
- In Java Card View, double-click on Sample_Device. In the Properties for Sample_Device dialog, select the CREF tab:
- Clear the Input file with EEPROM data, the Output file for EEPROM data, and the Combined (input and output) file for EEPROM data fields.
- Clear Do not open APDU console.
- Click OK.
- 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.
- 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.
Table of Contents
Java Card: 3 Platform Development Kit User Guide, Classic Edition
Expand |
Collapse