C H A P T E R  2

Installation

This release is provided for the Solaristrademark Operating System (Solaris OS) release 10, SuSE Linux, and Microsoft Windows XP as compressed zip archives. This release was built using gcc version 3.2.3 on Windows, 3.2.2 on Linux, and Suntrademark Studio 10: C 5.7 Compiler on Solaris. The GNU Compiler Collection, gcc, can be obtained at http://gcc.gnu.org.



Note - The Linux platform version was tested on the English language SuSE Linux, kernel 2.6.5-7.139, and gcc version 3.2.2. The Linux platform version is unsupported; Sun Microsystems may choose not to address problems or bug reports submitted against the Linux platform version.





Note - Do not overlay this release onto a previous release. Instead, perform the installation into a new directory.




Prerequisites for Installing the Binary Release

Be sure to install the binary release before installing the source release, which you must download separately.

1. Install the Javatrademark 2 Standard Edition (J2SEtrademark) Software Developer's Kit (SDK).

It is available from http://java.sun.com/j2se.

The supported SDK version is 1.5. If you are installing the SDK on the Solaris 10 or Linux platform, make sure that all of the required patches are installed. More information is available in the product documentation available at http://www.sun.com/software/solaris.

2. (Optional) Install javax.comm.

If, however, you are planning to use the development kit to communicate with a TLP224-compatible card reader, you must install javax.comm.

javax.comm can be found in the Java Communications API 2.0, available on Sun's web site at: http://java.sun.com/products/javacomm.  

Separate versions of the javax.comm API are available for the Solaris SPARC® technology and Microsoft Windows platforms.



Note - If you are using the development kit on the Linux platform, download the Solaris platform release of the javax.comm API and install only the Java Archive (JAR) files.


Follow the instructions provided in the file Readme.html to install the package. Make sure that the comm.jar file is added to the CLASSPATH.


Installing the Development Kit Binaries

There are three main steps for installing the development kit binaries. Separate sections cover installation for the Solaris, Linux, and Microsoft Windows platforms.

1. Installing development kit binary release files. See Installing on the Solaris or Linux Platform or Installing on the Microsoft Windows Platform.

2. Setting environment variables. See Setting Environment Variables for the Solaris or Linux Platform or Setting Environment Variables for Microsoft Windows Platform.

3. Installing Apache Ant and the Ant tasks bundle. See Installing Ant.


procedure icon  Installing on the Solaris or Linux Platform

The Java Card development kit provides separate download files for the binary release for the Solaris and Linux platforms.

1. Save the file in a convenient installation location of your choice.

For example, you might save the file in the directory /javacard. You must not install this release into an existing directory structure from a previous release.

2. Navigate to the directory where you saved the file.

In our example, navigate to /javacard directory with the following command:

% cd /javacard

3. Unzip the file provided with the release with the unzip utility.

Use the following command:

% unzip DevelopmentKitBinaryDistribution.zip 

where DevelopmentKitBinaryDistribution refers to the name of the bundle containing the binary release installation files for the Solaris or Linux platform.

The release's release documents, such as the release notes, are unzipped into the directory /javacard as well. The installation creates the subdirectory java_card_kit-2_2_2 under /javacard. The /javacard/java_card_kit-2_2_2 directory is now the root of the development kit installation.

4. Unzip the files in the directory java_card_kit-2_2_2.

Within the directory java_card_kit-2_2_2, you will find other zip files to unzip. Unzip all of these into the java_card_kit-2_2_2 directory. For a description of the files and directories that are installed under java_card_kit-2_2_2, see Files Installed for the Binary Release.

5. Follow the directions in the next section to set the environment variables required by the development kit.


procedure icon  Setting Environment Variables for the Solaris or Linux Platform

1. Set the environment variable JC_HOME to the installation directory.

For example (using csh), if you unzipped the release in the directory /javacard, use the following command:

setenv JC_HOME /javacard/java_card_kit-2_2_2

If you unzipped the installation into a different directory, define the environment variable JC_HOME accordingly.

2. Set the environment variable JAVA_HOME to the directory where you installed your Java technology development tools.

For example, setenv JAVA_HOME /usr/j2sdk1.5

The following optional path setting enables you to run the development kit tools from any directory.

setenv PATH .:$JC_HOME/bin:$PATH

To automate these environment settings, create a csh script file (named, for example, javacard_env.cshrc) that includes the setenv statements:

setenv JC_HOME /javacard/java_card_kit-2_2_2
setenv JAVA_HOME /usr/j2sdk1.5
setenv PATH .:$JC_HOME/bin:$JAVA_HOME/bin:$PATH:

Run the script file from the command prompt before running the development kit tools, samples, and demonstrations (refer to Chapter 3):

% source javacard_env.cshrc 

procedure icon  Installing on the Microsoft Windows Platform

The Java Card development kit provides a separate download file for the binary release for the Microsoft Windows XP platform.

1. Save the zip file in a convenient installation location of your choice.

For example, the root of the C: drive.

2. Unzip the file provided with the release with the Winzip utility.

The utility is available from http://www.winzip.com.
Use the following command to unzip the file:

C:\> winzip32 DevelopmentKitBinaryDistribution.zip 

where DevelopmentKitBinaryDistribution refers to the name of the bundle containing the installation files for the Microsoft Windows platform.

In the Winzip dialog, choose Select All and Extract from the Actions menu. Enter C:\ into the Extract To field to unzip the contents of the zip file into that directory. For more information on unzipping files, refer to the Winzip documentation. The release's release documents, such as the release notes, are unzipped into that directory as well.

The java_card_kit-2_2_2 directory is the root of the development kit installation.

3. Unzip the files in the directory java_card_kit-2_2_2.

Within the directory java_card_kit-2_2_2, you will find other zip files to unzip. Unzip all of these into the java_card_kit-2_2_2 directory. For a description of the files and directories that are unzipped into java_card_kit-2_2_2, see Files Installed for the Binary Release.

4. Follow the directions in the next section to set the Microsoft Windows platform environment variables required by the development kit.


procedure icon  Setting Environment Variables for Microsoft Windows Platform

1. Set the environment variable JC_HOME to the installation directory.

For example, if you unzipped the release in the root directory of the C: volume, enter this command:

set JC_HOME=c:\java_card_kit-2_2_2

If you unzipped the installation into a different directory, define the environment variable JC_HOME accordingly.

2. Set the environment variable JAVA_HOME to the directory where you installed your Java software development tools.

For example, the command will use the following format:

set JAVA_HOME=c:\j2sdk1.5

The following optional path setting enables you to run the development kit tools from any directory.

set PATH=%JC_HOME%\bin;%JAVA_HOME%\bin;%PATH%

To automate these environment settings, create a batch file (named, for example, javacard_env.bat) that includes the set statements:

@echo off
set JC_HOME=C:\java_card_kit-2_2_2
set JAVA_HOME=c:\j2sdk1.5
set PATH=.;%JC_HOME%\bin;%JAVA_HOME%\bin;%PATH%

Run the batch file from the command prompt before running the development kit tools, samples, and demonstrations (refer to Chapter 3).


procedure icon  Installing Ant

The development kit requires Ant to run the tools and the demos. Once Ant is installed and the Ant tasks bundle unzipped, the use of the Ant tasks within the development kit will not be apparent.



Note - The Ant tasks are supported for use with the development kit, but their use outside the development kit is not supported, nor have they been thoroughly tested.



1. Download and unzip Apache Ant in a separate directory.

If you don't already have Apache Ant version 1.6.2 installed on your system, you must download it from their web site at http://ant.apache.org. Unzip the package in a directory that is separate from the development kit.

2. Add Ant to your system path.

Add Ant's bin directory to your system path.

3. Unzip the Ant tasks bundle.

If you haven't already, unzip the Ant tasks bundle, which is included in the binary release. When you unzip the Ant tasks bundle, the Ant tasks' JAR file is extracted into the subdirectory java_card_kit-2_2_2/ant-tasks/lib. The documentation for the unsupported use of the Ant tasks outside the development kit is extracted into the subdirectory java_card_kit-2_2_2/ant-tasks/docs. For more information, see TABLE 2-1.


procedure icon  (Optional) Configuring PC/SC Functionality

If you are planning to use the development kit to communicate with a PC/SC-compatible card reader, which is optional and unsupported, you need to perform the following steps.

1. Create the file jpcsclite.properties in any directory listed in the CLASSPATH.

2. Edit jpcsclite.properties so that it contains the line:

lib.path=<path_to_the_bin_directory_of_the_development_kit>

An example of such a line is:

lib.path=/home/user/jcdevkit222/bin


Files Installed for the Binary Release

TABLE 2-1 describes the files and directories that the binary installation procedure installs under java_card_kit-2_2_2.



Note - If you are using the Microsoft Windows platform, substitute the \ character for / in the paths.




TABLE
2-1 Binary Release Directories and Files

Directory/File

Description

ant-tasks

Contains release notes, the JAR file of Ant tasks that run the development kit, and the Ant Tasks User's Guide. The guide is provided in both PDF and HTML format. The Ant tasks' Javadoc tool files are in the ant-tasks/docs/html/javadocs subdirectory and a PDF compilation of those Javadoc tool files are in the ant-tasks/pdf subdirectory.

The development kit will not operate properly unless Apache Ant and the Ant tasks are fully installed. However, use of the provided Ant tasks outside the development kit as described in the Ant Tasks User's Guide is not supported.

api_export_files

Contains the export files for version 2.2.2 of the Java Card API packages.

bin

Contains all shell scripts or batch files for running the tools (such as the apdutool, capdump, converter and so forth), and the cref binary executable. Also contains a dynamic library for PC/SC support.

doc

The devnotes and guides subdirectories contain the English-language guides for this release:

  • en/dev-notes - Contains a pdf subdirectory with the Application Programming Notes for the Java Card Platform, Version 2.2.2 in PDF format. The pdf subdirectory also contains a PDF file with a compilation of the Javadoc tool files for the APDU I/O API. The html subdirectory contains the same manual in HTML format, as well as a subdirectory containing the APDU I/O Javadoc tool files themselves.
  • en/guides - Contains a pdf subdirectory with this book in PDF format. The pdf subdirectory also contains a PDF file with a compilation of the Javadoc tool files for the Java Card RMI API. The html subdirectory contains this manual in HTML format, as well as a subdirectory containing the Java Card RMI Javadoc tool files themselves.

jc_specification

Contains the three Java Card specifications in both PDF and HTML formats.

lib

Contains all Java programming language JAR files required for the tools:

  • apdutool.jar and apduio.jar - Used by apdutool.
  • api.jar (with cryptography extensions) - Needed to write Java Card applets and libraries.
  • capdump.jar - Needed to produce an ASCII representation of a CAP file.
  • converter.jar - Needed to process Java class files and Java Card technology-based export files.
  • javacardframework.jar - Used by the Java technology-based RMIC compiler for generating stubs for Java Card RMI applications.
  • jcclientsamples.jar - Contains the client part of the Java Card RMI samples.
  • jcrmiclientframework.jar - Contains the classes of the Java Card RMI Client API.
  • jcwde.jar (with cryptography extensions) - Used by Java Card WDE.
  • installer.jar - Contains the installer applet.
  • offcardverifier.jar - Needed to evaluate CAP and export files in a desktop environment.
  • scriptgen.jar - Needed to convert a package in a CAP file into a script file containing a sequence of APDUs.

samples

Contains sample applets and demonstration programs. For more information on the contents of this directory, see Sample Programs and Demonstrations.


Sample Programs and Demonstrations

All samples are contained in the samples directory under JC_HOME. TABLE 2-2 describes the contents of that directory.


TABLE
2-2 Directory Structure for Sample Programs and
Demonstrations

Directory/File

Description

classes

Contains prebuilt sample classes.

build_demos.xml

Build script used to build demos. (Does not work without source bundle installation.)

build.properties

A properties file used by Ant to build samples.

build_samples

or

build_samples.bat

A script or batch file to automate building samples.

build_samples.xml

Ant XML script to build samples.

build.xml

Ant build file.

src

Contains the sources for the sample applets that belong to the packages com.sun.javacard.samples.*.

src/demo

Contains all of the files needed to run the Java Card platform demonstration programs. For more information on the contents of the demo directory, see Directories and Files in the demo Directory.

src/com/sun/javacard/samples

Contains the source code for the sample applets.

src_client

Contains sample card acceptance device (CAD) client programs for the Photo Card, Java Card RMI, and secure Java Card RMI demos.

Also contains the file jcclient.properties.

usage.xml

Contains the Ant XML target that shows the user a help message related to building samples and demos.