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:
-
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 -
Use the
AMService
API to write a client for applet management. -
Start the
JCDK-Simulator
in debug mode.You must set the
-debug_port
option so thatJCDK-Simulator
opens the specified port to communication with debug proxy. Without this option, the debugging functionality inJCDK-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]
-
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()
andprocess(
) methods. -
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
-
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: