Running the Debug Proxy from the Command Line

If you are not using the JCDK Eclipse Plug-in 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. Use the AMService API to write a client for applet management.

  3. Start the JCDK-Simulator in debug mode.

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

    For example (depending on your operating system):

    %JC_HOME_SIMULATOR%\runtime\bin\jcsw.exe -debug_port=9090 [options]

    ${JC_HOME_SIMULATOR}/runtime/bin/jcsl -debug_port=9090 [options]

  4. Run the Java client to deploy the applet.

    At a minimum, the applet load must be executed before the debug proxy connects to the VM. Other commands can be executed later to debug the applet's install() and process() methods.

  5. Start jc-debug-proxy.

    For example:
    java -jar jc-debug-proxy.jar -capPath 
    ${JC_HOME_SIMULATOR}/samples/HelloWorld/applet/deliverables/HelloWorld/com/oracle/jcclassic/samples/helloworld/javacard/helloworld.cap -port 8000 -vmPort 9090
  6. Attach the debugger to the debug proxy.

    A 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: