There is a Java Card emulator bundled with the Java Card Development Kit. If you plan on using a real card at some stage, get version 2.2.1 or 2.2.2 as I would not expect any version 3 cards for a while. You will still need an applet to put on the card. A java card does nothing by itself. It isn't until you load a card applet that it will perform any useful function.
One problem with the emulator in the JCDK is that you cannot use javax.smartcardio to access the card and this is the prefered method at the moment for communicating with a card. The other popular alternative, OpenCard Framework, has not been actively maintained in some time.