provided by: 
Originally published at Internet.comReview Part 1
As promised, in this conclusion to our two-part article, we will run an applet in a Java Card Simulator. This document contains only the setup and methods to run the Java Card applet in the simulator jcwde. The apdutool will act as the host application for sending command APDU.
Downloading
You can download the Java Card 2.1.1 Development Kit here (Please begin with Version 2.1.1 and move on to 2.1.2.).
Unzip the Windows .zip file that you have downloaded as a self-created directory, jc211.
Environment Setup
Set up these environment variables.
set JC21BIN=d:\jc211\bin set PATH=%PATH%;%JC21BIN%
You can create a separate jc211env.bat file so that you just have to run that batch file. The batch file can be created like this:
@echo off set JC21BIN=d:\jc211\bin set PATH=%PATH%;%JC21BIN%
Important: Open two windows one after another and set the paths in each window. These windows will work for simulating the Java Card environment and the host application.
Steps to run the applet in Java Card:
1. Compile the class. 2. Use Converter to produce CAP, EXP, and JCA files. Converter is an off-card VM that checks whether your applet is using a correct subset of the Java language and loads the classes of the package. 3. Then you run simulator JCWDE that simulates the applet as if it were running in the ROM of a card. It emulates the card environment. The Simulator takes the jcwde.app file that tells you where and what applet needs to mask. 4. Run the apdutool, which takes a script file (having command APDUs) and sends to JCWDE (simulator) where the C-APDU processed by your applet is, and the result is sent by JCWDE back to the apdutool...
Read article at Internet.com site