Running the Debug Proxy from the Command Line

If you are not using Eclipse for development, you can run the debug proxy and attach another Java technology-enabled debugger to it from the command line.

To run the debugger:

  1. Compile the application's class files using the -g option. If the -g option is not used, it is not possible to set breakpoints in the source code

  2. Generate APDU scripts for applet installation, instance creation and selection by using the script generator tool (scriptgen.bat).

  3. Start cref in debug mode.

    You must set the -debugPort option so that cref opens the specified port to communication with debug proxy. Without this option, the debugging functionality in cref is disabled.

    For example:

    JC_HOME_SIMULATOR\bin\cref_tdual.exe -debugPort 9090[options]

  4. Run the APDU scripts.

    APDU scripts can be executed using apdutool.bat. At a minimum, the installation script must be executed before the debug proxy connects to the VM. Other scripts can be executed later to debug the applet's install() and process() methods

  5. Start jc-debug-proxy as described in Starting the Debugger.

    For example:

      java.exe -jar lib\jc-debug-proxy.jar -capPath C:\workspace\HelloWorld\deliverables\hello\javacard\hello.cap -vmPort 9090   -port 8000

  6. Attach the debugger to the debug proxy.

    NetBeans or any other Java-compatible debugger can be used to connect to the debug proxy using the JDWP protocol. The debugger needs to be configured to connect to the remote Java application running on a specific host and port.

For an example, see: