Running the HelloWorld Sample in Eclipse

Run the HelloWorld sample using the APDU console.

Start Eclipse. Sample_Platform and Sample_Device must already be created.
  1. Using the File menu, select Import > General > Projects from Folder or Archive, and select the applet directory from the HelloWorld project, to import the HelloWorld Java Card project into your workspace. If the build doesn't start automatically, start it manually.
    The build generates the scripts and puts them in the apdu_scripts directory. It puts the outputs from the converter (cap, jca, and exp files) in the deliverables directory.
  2. If you don’t see the Java Card view, go to the Window menu, select Show View and Other... In the list, expand Oracle Java Card SDK and select Java Card view.
  3. Before you start any script you must change the PowerDown parameters for generating the script files. To change the PowerDown parameters:
    1. In the Package Explorer view, click the HelloWorld 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 HelloWorld 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 the Java Card View, right-click on Sample_Device and select Start.
    The simulator starts and you can see the output in the Console view.
  5. In the Sample_Device console toolbar, click on the Select script drop-down and execute these scripts:
    • cap-com.sun.jcclassic.samples.helloworld
    • create-com.sun.jcclassic.samples.helloworld.HelloWorld
    • helloworld
    The scripts are submitted to the simulator and you can see the output.
Compare the output in the Console view with the contents of the HelloWorld.expected.output file.