Quick Start

Overview

The following guide gives you a quick guide on how to work with the JCOP Tools for Eclipse to create a new applet, compile and test it.

Contents

Development process

The IDE integrates all of the necessary development steps for a JavaCard application starting with editing the application source, compiling and generating the JavaCard bytecode, testing and debugging it in the simulation environment, and finally executing it on real hardware.

Initially, you create a new project (or open one of the existing sample projects) which then contains and saves all the data related to your JavaCard application. You can add or remove classes from the project, and edit the individual sources in Eclipse's Java Editor. Depending on your Eclipse preferences, your application is compiled during every save operation. Alternatevely, you can manually build your applet. CAP files are built after every successful Java compile. Any errors are listed in the Tasks pane, and highlighted in the Java Editor if apropriate. You can then start the shell and the JCOP simulation process (with or without the debugger), to test your application works and/or to debug it.

The simulation process is a native Windows or Linux process, but behaves extremely similar to a real JCOP card, and allows for a faster testing and debug process. The shell is a command line environment which understands many application-specific commands and allows for the convenient APDU exchange between your host machine and the smartcard.

Creating projects

  1. Start the "New Project" wizard. (File > New > Project)

    File > New > Project
  2. From the "IBM JCOP Development Tools" category, select "JavaCard Project" and click on next.

    New Project wizard
  3. Enter a name for the new project.

    Project name
  4. Choose a JCOP target and define directories for source files, builder output, and shell scripts.

    Project name
  5. Choose a wizard that will create the initial project layout and code.

    Project code generation wizard
  6. Enter the properties for the new JavaCard applet.

    Applet properties
  7. Click on "Finish". The wizard will now create your new project.

Testing with Shell/VM

  1. Open the Debug Launch Configuration dialog. (Run > Debug...)
  2. Choose "IBM JCOP Card Simulator" and click on "New".

    Launch Configuration dialog
  3. On the Target tab, select the JCOP project and target you want to run or debug against.

    Target tab
  4. On the Shell tab, you can configure the start-up of your applet.

    Shell tab
  5. Click on "Debug". The simulation will now start.
  6. Eclipse will now automatically switch to the "JCOP Debug" perspective, where the JCOP Shell is available.

    JCOP Shell

Debugging

  • To set a break point, double-click on the marker bar on the left of the Java Editor. A blue dot with a little check mark indicates an active breakpoint.

    Breakpoint
  • When a breakpoint is hit, execution suspends and the current line of code is highlighted in the Java Editor.

    Breakpoint hit
  • The current stack trace is available in the Debug view, which also contains buttons for stepping, resuming and terminating.

    Stack
  • Variables in the current scope can be inspected in the Variables view.

    Variables
  • Information about card memory is available in the Memory Information view.

    Memory