Preface

Java Cardtrademark technology combines a subset of the Javatrademark programming language with a runtime environment optimized for smart cards and similar small-memory embedded devices. The goal of Java Card technology is to bring many of the benefits of Java software programming to the resource-constrained world of devices such as smart cards.

The Classic Edition of the Java Card platform is defined by three specifications: this Virtual Machine Specification, Java Card Platform, Version 3.0.1, Classic Edition, the Application Programming Interface for the Java Card Platform, Version 3.0.1, Classic Edition, and the Runtime Environment Specification, Java Card Platform, Version 3.0.1, Classic Edition.

This specification describes the required behavior of the Classic Edition’s virtual machine (VM) for the Java Card 3 platform (“Java Card virtual machine” or “Java Card VM”), that developers should adhere to when creating an implementation. In this book, Java Card 3 Platform refers to both versions 3.0 and 3.0.1 to distinguish them from all earlier versions. An implementation within the context of this document refers to a licensee’s implementation of the Java Card virtual machine, Application Programming Interface (API), Converter, or other component, based on the Java Card technology specifications. A “reference implementation” is an implementation produced by Sun Microsystems, Inc. Application software written for the Java Card platform is referred to as a Java Card technology-based applet (“Java Card applet” or “card applet”).


Who Should Use This Specification

This document is for licensees of the Java Card technology to assist them in creating an implementation, developing a specification to extend the Java Card technology specifications, or in creating an extension to the Classic Edition runtime environment for the Java Card platform (“Java Card Runtime Environment” or “Java Card RE”). This document is also intended for Java Card applet developers who want a more detailed understanding of the Java Card technology specifications.


Before You Read This Specification

Before reading this document, you should be familiar with the Java programming language, the Java Card technology specifications, and smart card technology. A good resource for becoming familiar with Java technology and Java Card technology is the Sun Microsystems, Inc. web site, located at

http://java.sun.com

This specification is not intended to stand on its own; rather it relies heavily on existing documentation of the Java platform. In particular, two books are required for the reader to understand the material presented here.

The Java Language Specification by James Gosling, Bill Joy, and Guy L. Steele (Addison-Wesley, 1996) ISBN 0-201-31008-2, contains the definitive definition of the Java programming language. The Java Card 3 platform language subset defined here is based on the language specified in this book.

The Java Virtual Machine Specification (Second Edition) by Tim Lindholm and Frank Yellin. (Addison-Wesley, 1999) ISBN 0-201-43294-3, defines the standard operation of the Java Virtual Machine (JVMtrademark software)[1]. The Java Card virtual machine presented here is based on the definition specified in this book.


How This Specification Is Organized

Chapter 1, “Introduction” provides an overview of the Java Card virtual machine architecture.

Chapter 2, “A Subset of the Java Virtual Machine” describes the subset of the Java programming language and Java Virtual Machine that is supported by the Java Card specification.

Chapter 3, “Structure of the Java Card Virtual Machine” describes the differences between the Java virtual machine and the Java Card virtual machine.

Chapter 4, “Binary Representation” provides information about how programs written for the Java Card platform are represented in binary form.

Chapter 5, “The Export File Format” describes the export file used to link code against another package.

Chapter 6, “The CAP File Format” describes the format of the CAP file.

Chapter 7, “Java Card Virtual Machine Instruction Set” describes the bytecodes (opcodes) that comprise the Java Card virtual machine instruction set.

Chapter 8, “Tables of Instructions” summarizes the Java Card virtual machine instructions in two different tables: one sorted by Opcode Value and the other sorted by Mnemonic.

Glossary provides definitions of selected terms in the entire Classic Edition.


Using UNIX Commands

This document might not contain information about basic UNIX® commands and procedures such as shutting down the system, booting the system, and configuring devices. Refer to the following for this information:

http://docs.sun.com


Shell Prompts


Shell

Prompt

C shell

machine-name%

C shell superuser

machine-name#

Bourne shell and Korn shell

$

Bourne shell and Korn shell superuser

#



Typographic Conventions


Typeface[2]

Meaning

Examples

AaBbCc123

The names of commands, files, and directories; on-screen computer output

Edit your .login file.

Use ls -a to list all files.

% You have mail.

AaBbCc123

What you type, when contrasted with on-screen computer output

% su

Password:

AaBbCc123

Book titles, new words or terms, words to be emphasized. Replace command-line variables with real names or values.

Read Chapter 6 in the User’s Guide.

These are called class options.

You must be superuser to do this.

To delete a file, type rm filename.



Documentation, Support, and Training


Sun Function

URL

Documentation

http://www.sun.com/documentation/

Support

http://www.sun.com/support/

Training

http://www.sun.com/training/



Related Documentation

References to various documents or products are made in this document. You should have the following documents available:


Acknowledgements

Java Card technology is based on Java technology. This specification could not exist without all the hard work that went into the development of the Java platform specifications. In particular, this specification is based significantly on Java Virtual Machine Specification. In order to maintain consistency with that specification, as well as to make differences easier to notice, we have, where possible, used the words, the style, and even the visual design of that book. Many thanks to Tim Lindholm and Frank Yellin for providing a solid foundation for our work.


Third-Party Web Sites

Sun is not responsible for the availability of third-party web sites mentioned in this document. Sun does not endorse and is not responsible or liable for any content, advertising, products, or other materials that are available on or through such sites or resources. Sun will not be responsible or liable for any actual or alleged damage or loss caused by or in connection with the use of or reliance on any such content, goods, or services that are available on or through such sites or resources.


Sun Welcomes Your Comments

Sun Microsystems is interested in improving its documentation and welcomes your comments and suggestions. You can submit your comments to
jc-bandol-spec-feedback@sun.com.

Please include the title of your document with your feedback:

Virtual Machine Specification, Java Card Platform, v3.0.1, Classic Edition


1 (Footnote) The terms "Java Virtual Machine" and "JVM" mean a Virtual Machine for the Java(TM) platform.
2 (TableFootnote) The settings on your browser might differ from these settings.