The Java Card Virtual Machine (JCVM) specification defines a subset of the Java programming language and a virtual machine for smart cards, including binary data representation and file format, and JCVM instruction sets.
A virtual machine for the Java Card platform is two parts implementations, part of the card, part runs in the card itself. Java Card virtual machine on the card interprets the bytecode, management classes, and objects, and more. The external Java virtual machine part is a development tool, which is generally called Java Card conversion tool, load, test, and further preparation card applet Java class for execution on the card. The conversion tool output is a CONVERTED Applet (CAP) file, which is a file containing all classes in a Java package. Whether the conversion program inspection class follows the Java Card specification. JCVM only supports a limited subset of Java programming languages, but it retains many familiar features, including objects, inheritance, package, dynamic object creation, virtual methods, interfaces, and exceptions. The JCVM specification waives support for many language elements, because these language elements may use a lot of smart cards that are very limited memory: Table 1, Java Card language restrictions Summary information
Language Characteristics Dynamic Class Loading, Safety Management (Java.lang.securityManager, thread, object cloning, and some aspects of package access control is not supported. Keywords do not support Native, Synchronized, Transient, Volatile, and Strictfp. Types do not support char, double, float, and long, no multi-dimensional arrays. Support for INT is optional. Category and interfaces do not support Java core applications programming interface classes and interfaces other than Object and Throwable (java.io, java.lang, java.util), and most of Object and Throwable are not available. Exception and Error subclasses are omitted because their unusual and errors cannot appear on the Java Card platform.
There is also a program limit. For example, a load library class cannot be extended to the card; it implies a final type. In order to comply with the storage restriction, the JCVM specification additionally defines the constraints of many program properties. Table 4 JCVM resource limit summary. Note that many of these constraints are very clear for Java Card developers. Summary information of the table 2, Java Card virtual machine constraint
Package a package can reference 128 other packages a fully desirable program package name to 255 bytes. Note that the character size depends on character encoding. A completely desirable program package is limited to 255 bytes. A class of categories can achieve 15 interfaces directly or indirectly. A interface can inherit up to 14 interfaces. A package If you contain a small application (a small application package), it can have up to 256 static methods; if there is no applet (library package), it can only have 255 static methods. A class can achieve up to 128 public or protected instance methods.