Java card is a new kind of smart card based on the Java language.An applet executing on a Java card faces the scarce memory resources and the fixed execution time constraints.For this reason,it is very essential to optimize the cap file that is loaded to the card.A design of the Java card bytecode optimize based on redefined instructions and basic-block compression is put forward in this paper.We can obtain the bytecode files which have a smaller size,and a minimal execution time penalty.