- Development Kit User Guide
- Setup, Samples and Tools
- Running the Samples
- Running the classic_applets Samples
- Service Sample
- Running the Service Sample in Eclipse
Running the Service Sample in Eclipse
Run this sample using Run Configuration and the APDU console in Eclipse.
Start Eclipse. Sample_Platform and Sample_Device must already be created.
- Import the
Service
Java Card project into your workspace. If the build doesn't start automatically, start it manually.The build createsapdu_scripts
anddeliverables
directories. - 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.
- Before you configure, run, and 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-Service.script
file and interrupts any execution of the following script files. To change the PowerDown parameters:- In the Package Explorer view, click
Service
Java project . - Right-click on the Java Card project and select Java Card and CAP Files Settings.
- Select a CAP file from the list that appears in the Java Card CAP Files page.
- Click Service and select Edit.
- In the Edit mode, select Compact CAP File.
- Click Next>.
- Select ScriptGen slide and select the Suppress "PowerDown;" APDU command at the end of CAP script check box.
- Click Finish and select Apply and Close.
- In the Package Explorer view, click
- In the top menu, select Run and Run Configurations...
- In the Run Configurations dialog:
- Right-click on Java Card Project Run and select New.
- In the Name field, enter Service
- Click Browse..., select the Service project, and click OK.
- Select Start simulator.
- In the Scripts to be executed on simulator list box, add the following scripts:
-
Browse to the
JC_HOME_SIMULATOR\samples\classic_applets\Service\applet\apdu-scripts
directory and choosecap-com.sun.jcclassic.samples.service.script
-
From the same directory, select
service.scr
-
- Click Run
The simulator starts and executes the scripts in the list box, and you can see the output in the Console view.Compare the output with the contents of the
service.expected.output
file.